Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix declaration error when using clang
When compile the rv32emu using clang, the error log shows the following: src/emulate.c:1127:5: error: expected expression rv_insn_t ir; According to [1], syntax of lebeled-statement stated in the following: labeled-statement: identifier : statement case constant-expression : statement default : statement Obviously, only the statement is valid after labeled-statement. When refering to [2], the following are the valid statements, excluding the declaration. statement: labeled-statement compound-statement expression-statement selection-statement iteration-statement jump-statement Thus, move the declaration of ir before the labeled-statement eliminates the clang compile error. [1] C99 6.8.1 Labeled statements [2] C99 6.8 Statement and blocks
- Loading branch information