C++ preprocessor bug or not ?

Nathan Sidwell nathan@codesourcery.com
Tue Feb 6 04:03:00 GMT 2001


John Levon wrote:
> 
> The following code (cut from qt 1.45) :
> 
> #if defined(xor)
> // blah
> #endif
> 
> is not appreciated by g++ > 2.95.2
this should work, see attached where I've tried `if' too. `if' works, `xor' does
not.
Please file bug report
nathan@uha:6>./g++ -B ./ -E current/zap.C 
# 4 "current/zap.C"
current/zap.C:7:14: "defined" without an identifier
not if





not xor


ouch!

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
#if defined (if)
is if
#else
not if
#endif

#if defined (xor)
is xor
#else
not xor
#endif



More information about the Gcc mailing list