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

C++ header file problem - is this a bug?


Problem C++ code:
#include <iostream>
#include <math.h>
isnan(x);

Preprocessing this on MacOS X 10.3.7 isnan(x) is unchanged, which is incorrect, because in math.h isnan() is a macro and should have been substituted.

If I comment out the first line the substitution becomes
isnan(x) -->
( ( sizeof ( x ) == sizeof(double) ) ? __isnand ( x ) : ( sizeof ( x ) == sizeof( float) ) ? __isnanf ( x ) : __isnan ( x ) )
which is correct.


I have reproduced this with both gcc3.3 and gcc 4.0.

Is this a bug or is it expected behaviour and if so why?

Bill Northcott


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