Strange result with #ifdef with gcc 2.95.2
shikhar
shikhar@utstar.com
Fri May 31 09:16:00 GMT 2002
Hello:
I am having different results for compiling same C statement for 2.95.2 gcc
compiler, one is loaded on my Sun-Solaris system, and another is being used
for RTEMS target compilation on Windows2000.
The line : #ifdef X || Y
is considered as an error in the Unix system , but for the cross-compilation
it is a warning and the end result is equivalent as only "#ifdef X". I have
tried to understand if it is any compiler option/flag that is making the
compiler behave in two different ways, but I could not find it. I also tried
to search in the gnu online help but could not see any info about it.
I will highly appreciate if someone helps me.
Thanks,
Shikhar Sarkar
New Jersey
P.S. I realize that by using "#if defined X || defined Y" will solve the
matter. But I am curious why are the two compilers behaving in a different
way.
More information about the Gcc-help
mailing list