Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Project Explorer #undef warning
Project Explorer #undef warning [message #1764917] Sat, 03 June 2017 14:57 Go to next message
dh 29 is currently offline dh 29Friend
Messages: 3
Registered: June 2017
Junior Member
I am using Eclipse Mars.2 Release (4.5.2) under WIn10.

This is my 1st attempt of cross compiling on a Win machine for an ARM / Linux target (happens to be an iMX7). I am using a Linaro tool-chain.

A simple project using 'pthreads' compiles OK without any warnings.

Whats annoying me is that I have ten #undef warnings in the Project Explorer window (see attached) that I don't understand.

Can anybody explain / help?

Re: Project Explorer #undef warning [message #1765001 is a reply to message #1764917] Mon, 05 June 2017 16:27 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
This looks like CDT is interpretting some of the #undefs as include directories. That (obviously) shouldn't happen, but it should also be innocuous.

I have tried to reproduce on my machine, with gcc-linaro-6.3.1-2017.05-i686-mingw32_arm-linux-gnueabihf.tar.xz and Neon.3 (which is the most recent release) and although I can see those #undefs in the output of the command CDT runs to find out includes and defines, I can't see how it could be getting it wrong.

I will download Mars.2 to see if it fails there.

[Updated on: Mon, 05 June 2017 16:28]

Report message to a moderator

Re: Project Explorer #undef warning [message #1765005 is a reply to message #1765001] Mon, 05 June 2017 16:39 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
Mars.2 works ok for me too.

I am pretty sure you can just ignore it as those #undefs are not directories, so no header files will be found there.

What you can do is force the scanner (the part of CDT that runs your gcc to find out includes) to run again. Perhaps there is a race condition as the #undefs are printed on stdout and the includes on stderr when running gcc.

To re-run manually:
0) Project properties -> C/C++ General -> Preprocessor Include Paths -> Providers tab
1) Select "CDT Cross GCC Built-in Compiler Settings"
2) (optional) Check the "Allocate console in the console view"
3) Press Clear entries
4) Press OK

See the screenshot if that helps.

This will re-run the scanner, if it gives a different result you have found some kind of race condition and I would be ever so grateful if you could report back or file a bug: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=CDT

If you did the optional step 2, you will now have a console that shows exactly what CDT did to get macros and include paths.

index.php/fa/29560/0/
Re: Project Explorer #undef warning [message #1765006 is a reply to message #1765005] Mon, 05 June 2017 16:43 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
More info if desired about scanner discovery: https://help.eclipse.org/neon/topic/org.eclipse.cdt.doc.user/reference/cdt_u_pref_build_scanner_discovery.htm and https://help.eclipse.org/neon/topic/org.eclipse.cdt.doc.user/concepts/cdt_c_scanner_discovery.htm
Re: Project Explorer #undef warning [message #1765021 is a reply to message #1765006] Mon, 05 June 2017 18:37 Go to previous messageGo to next message
dh 29 is currently offline dh 29Friend
Messages: 3
Registered: June 2017
Junior Member
Jonah, thanks for the suggestions and info links. Looks like I've got a lot to learn...in fact I know I've got a lot to learn!
I'll force a re-run of the CDT scanner and let you know the results.

Re: Project Explorer #undef warning [message #1765024 is a reply to message #1765021] Mon, 05 June 2017 19:27 Go to previous messageGo to next message
dh 29 is currently offline dh 29Friend
Messages: 3
Registered: June 2017
Junior Member
Jonah, I've forced a CDT re-scan as you described, but the ''#undef warnings' remained.

I've attached the console output for the CDT re-scan. Within this output there are some 'duplicate paths' listed - not sure if this is normal/expected?
Re: Project Explorer #undef warning [message #1765124 is a reply to message #1765024] Tue, 06 June 2017 20:48 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
OK, thanks for the info. I have reproduced your environment as well as I can (Win 10, Mars.2 same version of Linaro, even same paths) and for the longest time I could not reproduce the problem. In the end I decided to re-run the scan (clear entries) dozens of times and I have just reproduced the problem. I still believe that it does not hurt anything, but is still wrong (and potentially a sign of another bug lurking). I have raised https://bugs.eclipse.org/bugs/show_bug.cgi?id=517908 to fix/track the issue. Please add yourself to the CC list to track the progress.
Re: Project Explorer #undef warning [message #1765174 is a reply to message #1765124] Wed, 07 June 2017 09:02 Go to previous message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
This is now fixed. The fix will be available in the CDT that ships with Eclipse Oxygen in a few weeks time.
Previous Topic:Checksum Calculation
Next Topic:(symbol) could not be resolved
Goto Forum:
  


Current Time: Fri Apr 26 13:59:52 GMT 2024

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

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

Back to the top