This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/13279] New: C preprocessor doesn't work correctly with symbol expressions
- From: "xomicron at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Dec 2003 09:02:39 -0000
- Subject: [Bug c/13279] New: C preprocessor doesn't work correctly with symbol expressions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Following code works ok:
#if COMPILER==1
...
#else
...
#endif
But the code like
#if COMPILER==MSVC
...
#else
#endif
Always selects first branch with no mention to actual value of COMPILER. It
looks like CPP understands only numbers in such expressions, but allows to
assign string. MS VC works differently. I'm not sure if it is correct behavior.
Work around - to define used strings with macro like:
#define GNU 0
#define MSVC 1
--
Summary: C preprocessor doesn't work correctly with symbol
expressions
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: xomicron at mail dot ru
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13279