This is the mail archive of the gcc-help@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]

Strange result with #ifdef with gcc 2.95.2


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.


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