Please try to compile this simple 3-liner:
#if (4 >> 1 >> 1 != 1)
#error
#endif
--> fatal error C1012 !?
Now let's omit parentheses and try again:
#if 4 >> 1 >> 1 != 1
#error
#endif
--> warning C4067, and the #if computation is wrong !!
Same things happen if you use "<<" or mix them.
Finally it's interesting to note that this problem seems to be present
at least since MSC 6.0 (this is _MSC_VER == 600 back from 1990). And it
has been confirmed to persist in the latest VS 2005 betas :-)
Regards,
Markus F.X.J. Oberhumer
<mar...@oberhumer.com>
Have you filed a bug report on it for VS2005?
http://labs.msdn.microsoft.com/productfeedback/
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
I'd go ahead and file it, but I know that the VC team is aware the the
preprocessor has quite a number of conformance issues.
-cd
The following seems OK with the 2005 beta:
#if (4 >> 1) >> 1 != 1
Is that a possible work-around for now?