Skip to content

Commit 312c83f

Browse files
committed
Fix Clang error when disabling BLOCK_CHAINING
When using 'make ENABLE_MBLOCK_CHAINING=0 CC=clang', the following errors are observed: src/emulate.c:555:19: error: unused function 'insn_is_unconditional_branch' [-Werror,-Wunused-function] 555 | FORCE_INLINE bool insn_is_unconditional_branch(uint8_t opcode) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/emulate.c:582:19: error: unused function 'insn_is_direct_branch' [-Werror,-Wunused-function] 582 | FORCE_INLINE bool insn_is_direct_branch(uint8_t opcode) | ^~~~~~~~~~~~~~~~~~~~~ Fix this by guarding the 'insn_is_unconditional_branch' and 'insn_is_direct_branch' function definition with RV32_HAS(BLOCK_CHAINING) macro. This ensures the functions are only defined when the BLOCK_CHAINING is enabled.
1 parent 4d5a96a commit 312c83f

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
@@ -552,6 +552,7 @@ FORCE_INLINE bool insn_is_translatable(uint8_t opcode)
552552
}
553553
#endif
554554

555+
#if RV32_HAS(BLOCK_CHAINING)
555556
FORCE_INLINE bool insn_is_unconditional_branch(uint8_t opcode)
556557
{
557558
switch (opcode) {
@@ -592,6 +593,7 @@ FORCE_INLINE bool insn_is_direct_branch(uint8_t opcode)
592593
return false;
593594
}
594595
}
596+
#endif
595597

596598
FORCE_INLINE bool insn_is_indirect_branch(uint8_t opcode)
597599
{

0 commit comments

Comments
 (0)