Preprocessor symbols at the file level [message #1849419] |
Wed, 19 January 2022 10:30 |
Andrew Coad Messages: 4 Registered: January 2022 |
Junior Member |
|
|
Hi,
Environment: Eclipse IDE for Embedded C/C++ Developers (includes Incubating components) 2021-09 (4.21.0) running on Mac BigSur 11.4. JRE 8 update 321.
I have a set of -D preprocessor symbols set at the project level. Twice now, I have been developing code without any problems and then things suddenly break. Digging down, I find that certain files have a set of preprocessor symbols that are not the same as those at the project level. These file-level symbols did not get there through any action of my own. Here is a simple example:
#ifdef SEGGER_TRACE_ENABLED
SEGGER_RTT_WriteString(0, "Entering main loop\r\n");
#endif
What this symbol does is obvious. The symbol is set at the project level and this has been working fine until this past Monday morning when it suddenly stopped working.
Digging around, I discovered that the file that contains the above code, main.c, had a set of preprocessor symbols that does not include this SEGGER symbol.
How and why did this change happen? I have done nothing (consciously) to apply separate symbols to main.c and, specifically, remove that symbol. Why did it change over the weekend (after a shutdown/restart cycle)? This is not the first time this has happened.
How do I ensure that all files inherit the symbols from the project level unless I specifically change that? Related question, if I find that a file does have independent symbols, how do I get rid of them?
Regards,
AC
|
|
|
|
Powered by
FUDForum. Page generated in 0.03066 seconds