This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
C++ header file problem - is this a bug?
- From: Bill Northcott <w dot northcott at unsw dot edu dot au>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 4 Jan 2005 18:13:27 +1100
- Subject: 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