Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Preprocessor symbols at the file level(Files adopt separate PP symbols automatically)
Preprocessor symbols at the file level [message #1849419] Wed, 19 January 2022 10:30 Go to next message
Andrew Coad is currently offline Andrew CoadFriend
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
Re: Preprocessor symbols at the file level [message #1850641 is a reply to message #1849419] Fri, 11 March 2022 14:52 Go to previous message
Andrew Coad is currently offline Andrew CoadFriend
Messages: 4
Registered: January 2022
Junior Member
Asking the question a different way: Does anyone have any idea how to force Eclipse to use project-level preprocessor symbols (and ignore preprocessor symbols at the file level)?

[Updated on: Fri, 11 March 2022 14:53]

Report message to a moderator

Previous Topic:console log link to source line exists? in the works?
Next Topic:Noob setup for windows development
Goto Forum:
  


Current Time: Sat Oct 01 02:04:11 GMT 2022

Powered by FUDForum. Page generated in 0.03667 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top