Open
Description
Describe the bug
The generated C header includes definitions for all of the exception causes. These are not resolved and still have IDL conditionals in them, which is obviously not valid C.
To Reproduce
Steps to reproduce the behavior:
- Run .
/do gen:c_header
Text output/Error Messages
The issue is specifically with ecall exceptions. M and VS mode are fine, but S and U mode have issues because the exception name is conditional based on the H extension.
#define CAUSE_ENVIRONMENT_CALL_FROM_M_MODE 0xb
#define CAUSE_ENVIRONMENT_CALL_FROM_VS_MODE 0xa
#define CAUSE_ENVIRONMENT_CALL_FROM_<%-_IF_EXT?(:H)_-%>H<%-_END_-%>S_MODE 0x9
#define CAUSE_ENVIRONMENT_CALL_FROM_<%-_IF_EXT?(:H)_-%>V<%-_END_-%>U_MODE 0x8
Additional context
The best solution would be to include both names and have them defined to be the same value so either could be used. Alternatively, it would probably be ok to have just the names when H is not present as those are the more familiar/standard names.