Skip to content

Commit 25d3d1e

Browse files
committed
Fix Clang error with JIT when EXT_M is disabled
When using 'make ENABLE_EXT_M=0 ENABLE_JIT=1 CC=clang', the following error is observed: src/jit.c:728:20: error: unused function 'emit_alu64_imm8' [-Werror,-Wunused-function] 728 | static inline void emit_alu64_imm8(struct jit_state *state, | ^~~~~~~~~~~~~~~ Fix this by guarding the 'emit_alu64_imm8' function definition with RV32_HAS(EXT_M) macro. This ensures the function is only defined when the EXT_M is enabled.
1 parent 52f531b commit 25d3d1e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/jit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ static inline void emit_alu64(struct jit_state *state, int op, int src, int dst)
725725
#endif
726726
}
727727

728+
#if RV32_HAS(EXT_M)
728729
static inline void emit_alu64_imm8(struct jit_state *state,
729730
int op,
730731
int src UNUSED,
@@ -742,6 +743,7 @@ static inline void emit_alu64_imm8(struct jit_state *state,
742743
}
743744
#endif
744745
}
746+
#endif
745747

746748
/* Register to register mov */
747749
static inline void emit_mov(struct jit_state *state, int src, int dst)

0 commit comments

Comments
 (0)