Skip to content

Commit 01f2328

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 f71f435 commit 01f2328

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
@@ -550,6 +550,7 @@ FORCE_INLINE bool insn_is_translatable(uint8_t opcode)
550550
}
551551
#endif
552552

553+
#if RV32_HAS(BLOCK_CHAINING)
553554
FORCE_INLINE bool insn_is_unconditional_branch(uint8_t opcode)
554555
{
555556
switch (opcode) {
@@ -590,6 +591,7 @@ FORCE_INLINE bool insn_is_direct_branch(uint8_t opcode)
590591
return false;
591592
}
592593
}
594+
#endif
593595

594596
FORCE_INLINE bool insn_is_indirect_branch(uint8_t opcode)
595597
{

0 commit comments

Comments
 (0)