|Conditional compile not working [message #1851071]
||Sat, 26 March 2022 17:16
| Andrew Coad
Registered: January 2022
This is driving me slowly mad. Again, Eclipse is showing me one thing on screen and compiling something different.
See attached files. The first one shows what I am seeing on screen - the preprocessor symbol BOARD_SWIFT is shown as active; BOARD_AMP_MODULE inactive.
The second file shows the preprocessor symbols at the project level. As expected, BOARD_SWIFT is set to 1, BOARD_AMP_MODULE is set to 0.
However, when I run the code, neither option is in effect. You can see where the breakpoint actually hit - the code skipped over all of the #if/#elif delimited code.
The only way that I can get this code to execute properly is to put the same preprocessor settings on the file itself. This file happens to be main.c so if I put BOARD_SWIFT=1 and BOARD_AMP_MODULE=0 on main.c, the code runs as shown on screen.
Why? Why does Eclipse suddenly decide that I have to put symbols at the file level? How do I prevent Eclipse from using file-level symbols?
Powered by FUDForum
. Page generated in 0.02297 seconds