Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » __STDC__ always defined in CDT??(Source Parsing)
__STDC__ always defined in CDT?? [message #735594] Wed, 12 October 2011 06:11 Go to next message
Eclipse UserFriend
It seems the symbol __STDC__ is always defined while source parsing.
Compiling of the source does not define the symbol __STDC__.

How can I disable this feature?

reproduction (Eclipse Indigo):

1. create a new C or C++ project.
2. create a new file with following content

//#undef __STDC__

#if !__STDC__
#define TEST "TEST"
#endif

"#define TEST" is shown as unreachable. But if you uncomment "#undef __STDC__" the statement is getting reachable ?!

Regards,
Gert
Re: __STDC__ always defined in CDT?? [message #735639 is a reply to message #735594] Wed, 12 October 2011 09:10 Go to previous messageGo to next message
Eclipse UserFriend
AFAIK, CDT gets the symbol from the debugger (aka Scanner Discovery). Create an empty source file test.c and call on the command line
gcc -E -P -dD test.c

This will show you the default predefined symbols (for gcc!).
Re: __STDC__ always defined in CDT?? [message #735644 is a reply to message #735594] Wed, 12 October 2011 09:10 Go to previous messageGo to next message
Eclipse UserFriend
AFAIK, CDT gets the symbol from the debugger (aka Scanner Discovery). Create an empty source file test.c and call on the command line
gcc -E -P -dD test.c
This will show you the default predefined symbols (for gcc!).
--
Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
Re: __STDC__ always defined in CDT?? [message #735655 is a reply to message #735644] Wed, 12 October 2011 09:41 Go to previous messageGo to next message
Eclipse UserFriend
Sorry, I forgot to tell! I use the Microsoft Visual C++ tool chain with CDT Internal Builder. So gcc is no option for me.

Regards, Gert
Re: __STDC__ always defined in CDT?? [message #735927 is a reply to message #735655] Thu, 13 October 2011 02:47 Go to previous messageGo to next message
Eclipse UserFriend
Gert.Grossmann wrote on Wed, 12 October 2011 15:41
Sorry, I forgot to tell! I use the Microsoft Visual C++ tool chain with CDT Internal Builder. So gcc is no option for me.

Regards, Gert

Visual C++ defines __STDC__, too.
http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.80).aspx

You can try to remove the symbol from Project Properties->C/C++ General->Paths and Symbols
Re: __STDC__ always defined in CDT?? [message #735937 is a reply to message #735927] Thu, 13 October 2011 03:06 Go to previous message
Eclipse UserFriend
But Visual C++ does this symbol only define if /Za is on and we're not compiling C++ code.
So this define should depend on compiler switch /Za (switchable via Visual C++ Tool Chain)

Regards, Gert
Previous Topic:pre-build stripping backslashes in SubWCRev cmd
Next Topic:Project repeated under working set
Goto Forum:
  


Current Time: Wed Jul 30 14:13:17 EDT 2025

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

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

Back to the top