This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/13279] New: C preprocessor doesn't work correctly with symbol expressions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]