2023-02-06 06:52 AM
TouchGFX 4.21.1
When compiling for "Run Simulator" I get the following error message:
Run Simulator
Generate
Wrote generated/simulator/gcc/Makefile
Done
Generate Assets
make -f simulator/gcc/Makefile assets -j10 -Wno-error=sequence-point
Reading ./application.config
Reading ./target.config
Done
Post Generate
touchgfx update_project --project-file=../EWARM/EVK101008AB.ewp --gui-group-name=Application/User/TouchGFX/gui --generated-group-name=Application/User/TouchGFX/generated && touchgfx update_project --project-file=simulator/msvs/Application.vcxproj && touchgfx update_project --project-file=../MDK-ARM/EVK101008AB.uvprojx --gui-group-name=Application/User/TouchGFX/gui --generated-group-name=Application/User/TouchGFX/generated
Done
Compile
make -f simulator/gcc/Makefile -j10 -Wno-error=sequence-point
Reading ./application.config
Reading ./target.config
Compiling gui/src/model/Model.cpp
gui/src/model/Model.cpp: In member function 'void Model::tick()':
gui/src/model/Model.cpp:26:13: error: operation on 'counter' may be undefined [-Werror=sequence-point]
counter = (counter < COUNTER_PERIODE)?++counter:0;
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus.exe: all warnings being treated as errors
generated/simulator/gcc/Makefile:196: recipe for target 'build/MINGW32_NT-6.2/gui/src/model/Model.o' failed
make[2]: *** [build/MINGW32_NT-6.2/gui/src/model/Model.o] Error 1
make[2]: *** Waiting for unfinished jobs....
generated/simulator/gcc/Makefile:155: recipe for target 'generate_assets' failed
make[1]: *** [generate_assets] Error 2
simulator/gcc/Makefile:32: recipe for target 'all' failed
make: *** [all] Error 2
Failed
Failed
Where can I set the switch "-Wno-error=sequence-point" so that the compiler does not define this warning as an error and aborts?
I don't want to resolve the warning, I want the warning to not stop compiling.
Solved! Go to Solution.
2023-02-06 07:46 AM
2023-02-06 07:17 AM
You mean you want to have an error in your code? Why not this (assuming that counter is not declared volatile)?
counter = (counter < COUNTER_PERIODE) ? counter + 1 : 0;
If it is volatile - rethink what you are doing.
2023-02-06 07:42 AM
Hope you understand that warning and better resolve it.
Look for a compiler option -Werror and remove that, or add -Wno-error=sequence-point.
See https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html for all details.
hth
KnarfB
2023-02-06 07:46 AM
2023-02-06 08:18 AM
Thank you very much ferro.
I didn't feel like explaining to colleagues the difference between "++i", "i++", "i += 1" or "i = i + 1".
Sadly enough, GCC had to define a "warning" for this.
You saved me a lot of time and effort with your competent and solution-oriented answer.
Thank you very much!
2023-02-08 08:57 AM
Glad it helped !