7.1.0 C output: ENTRY_STATE macro in generated header undefined
Translates state machine into a target programming language.
Brought to you by:
cwrapp
In 7.0.0 and before, C generated header files from a .sm file where any state includes Entry {} actions contained the following:
#define AppClassContext_EnterStartState(fsm) \
do { \
if (getState(fsm)->Entry != NULL) { \
getState(fsm)->Entry(fsm); \
} \
} while (0)
In SMC 7.1.0, this is replaced by:
#define AppClassContext_EnterStartState(fsm) \
ENTRY_STATE(getState(fsm))
However the ENTRY_STATE macro is defined in the generated source file, not the header, so compiling can fail with an undefined symbol error.
Whether this happens (or is just reported as a warning) depends on the strictness of the compiler and whether building with NO_xyz_SM_MACRO defined. gcc throws an implicit definition warning and links it happily, while Keil throws a linker error:
Error: L6218E: Undefined symbol ENTRY_STATE (referred from fsm.o).
I assume the above comments apply to
EXIT_STATEmacro as well. As such a fix will be applied to bothENTRY_STATEandEXIT_STATEmacros.Corrected in SMC release 7.2.0.