Skip to content

Commit ad7f3b9

Browse files
committed
Fix unused variable warning when JIT and SYSTEM are enabled
When building with make 'ENABLE_JIT=1 ENABLE_SYSTEM=1', the following error is observed: src/emulate.c:45:13: error: ‘need_clear_block_map’ defined but not used [-Werror=unused-variable] 45 | static bool need_clear_block_map = false; | ^~~~~~~~~~~~~~~~~~~~ Fix this by guarding the 'need_clear_block_map' definition with the RV32_HAS(SYSTEM) and !RV32_HAS(JIT) macros. This ensures the variable is only defined when the macros indicate it is needed.
1 parent 2c16b2c commit ad7f3b9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/emulate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ extern struct target_ops gdbstub_ops;
4242
#define IF_imm(i, v) (i->imm == v)
4343

4444
#if RV32_HAS(SYSTEM)
45+
#if !RV32_HAS(JIT)
4546
static bool need_clear_block_map = false;
47+
#endif
4648
static uint32_t reloc_enable_mmu_jalr_addr;
4749
static bool reloc_enable_mmu = false;
4850
bool need_retranslate = false;

0 commit comments

Comments
 (0)