Default transition in Default state generates unused function
Translates state machine into a target programming language.
Brought to you by:
cwrapp
When building with gcc -Wall, generated state machine source file contains an unused _Default() function. To reproduce:
$ git clone https://git.code.sf.net/p/smc/git-code smc-git-code
$ cd smc-git-code/examples/C/EX1
// Edit AppClass.sm to add:
// Default
// {
// Default nil {}
// }
$ java -jar ../../../bin/Smc.jar -c AppClass.sm
$ gcc -Wall -g -I../../../lib/C -o checkstring AppClass_sm.c AppClass.c main.c
// Output:
// AppClass_sm.c:39:13: warning: ‘AppClassState_Default’ defined but not used [-Wunused-function]
// 39 | static void AppClassState_Default(struct AppClassContext *const fsm)
// | ^~~~~~~~~~~~~~~~~~~~~
Many organizations standardize on running gcc with -Wall -Werror, requiring file-wise workarounds to disable this warning. All macros defined to AppClassState_Default() are re-defined to use Map1_DefaultState_Default().
Fix will appear in SMC release 7.2.0.
Corrected in SMC release 7.2.0.