Skip to content

Commit f3ebd90

Browse files
committed
Fix several or surpress build variable warnings.
1 parent e198b2d commit f3ebd90

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# For MSVC_RUNTIME_LIBRARY
22
cmake_minimum_required(VERSION 3.15)
33

4-
add_compile_options(-Wno-missing-braces -Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context)
4+
if (CMAKE_C_COMPILER_ID MATCHES "MSVC")
5+
add_compile_options(/W1 /w14189 /w16268)
6+
else()
7+
add_compile_options(-Wno-missing-braces -Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context)
8+
endif()
59

610
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
711
message(FATAL_ERROR "In-tree builds are not supported. Run CMake from a separate directory: cmake -B build")

arch/SH/SHDisassembler.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@ static bool op0xx8(uint16_t code, uint64_t address, MCInst *MI, cs_mode mode,
374374
{-1, SH_INS_INVALID, ISA_ALL, none},
375375
};
376376

377-
int lvl = isalevel(mode);
378377
sh_insn insn = lookup_insn(list, insn_code, mode);
379378
if (code & 0x0f00)
380379
return MCDisassembler_Fail;
@@ -730,8 +729,6 @@ static bool op4xx5(uint16_t code, uint64_t address, MCInst *MI, cs_mode mode,
730729
sh_info *info, cs_detail *detail)
731730
{
732731
int r = (code >> 8) & 0x0f;
733-
uint16_t *regs;
734-
uint8_t *count;
735732
enum direction rw;
736733
static const struct ri_list list[] = {
737734
{0, SH_INS_ROTR, ISA_ALL, none},
@@ -1130,7 +1127,6 @@ opLDRSE(LDRE)
11301127
static bool op##insn##_i(uint16_t code, uint64_t address, MCInst *MI, \
11311128
cs_mode mode, sh_info *info, cs_detail *detail) \
11321129
{ \
1133-
int dsp = code & 0x00ff; \
11341130
MCInst_setOpcode(MI, SH_INS_##insn); \
11351131
set_imm(info, 0, code & 0xff); \
11361132
set_reg(info, SH_REG_R0, write, detail); \
@@ -1146,7 +1142,6 @@ opImmR0(OR)
11461142
static bool op##insn##_B(uint16_t code, uint64_t address, MCInst *MI, \
11471143
cs_mode mode, sh_info *info, cs_detail *detail) \
11481144
{ \
1149-
int dsp = code & 0x00ff; \
11501145
MCInst_setOpcode(MI, SH_INS_##insn); \
11511146
set_imm(info, 0, code & 0xff); \
11521147
set_mem(info, SH_OP_MEM_GBR_R0, SH_REG_R0, 0, 8, detail); \
@@ -1587,7 +1582,6 @@ static bool set_dsp_move_d(sh_info *info, int xy, uint16_t code, cs_mode mode, c
15871582
int a;
15881583
int d;
15891584
int dir;
1590-
int sz;
15911585
int op;
15921586
static const sh_reg base[] = {SH_REG_DSP_A0, SH_REG_DSP_X0};
15931587
switch (xy) {
@@ -1802,7 +1796,6 @@ static bool dsp_op_cc0_2opr(uint32_t code, sh_info *info, sh_insn insn,
18021796
static bool decode_dsp_3op(const uint32_t code, sh_info *info,
18031797
cs_detail *detail)
18041798
{
1805-
int r;
18061799
int cc = (code >> 8) & 3;
18071800
int sx = (code >> 6) & 3;
18081801
int sy = (code >> 4) & 3;
@@ -2030,8 +2023,6 @@ static bool decode_dsp_3op(const uint32_t code, sh_info *info,
20302023
static bool decode_dsp_p(const uint32_t code, MCInst *MI, cs_mode mode,
20312024
sh_info *info, cs_detail *detail)
20322025
{
2033-
bool ret;
2034-
20352026
int dz = code & 0x0f;
20362027
MCInst_setOpcode(MI, SH_INS_DSP);
20372028
if (!decode_dsp_d(code >> 16, MI, mode, info, detail))

tests/test_sh.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ static void print_string_hex_short(unsigned char *str, size_t len)
3737
printf("%02x", *c & 0xff);
3838
}
3939

40-
static const char *s_access[] = {
41-
"UNCHANGED", "READ", "WRITE", "READ | WRITE",
42-
};
43-
4440
static void print_read_write_regs(csh handle, cs_detail *detail)
4541
{
4642
int i;
@@ -89,7 +85,6 @@ static void print_insn_detail(csh handle, cs_insn *insn)
8985

9086
for (i = 0; i < sh->op_count; i++) {
9187
cs_sh_op *op = &(sh->operands[i]);
92-
const char *comment;
9388

9489
switch ((int)op->type) {
9590
default:

0 commit comments

Comments
 (0)