This is the mail archive of the
mailing list for the GCC project.
Re: C++ header file problem - is this a bug?
Matt Austern <email@example.com> writes:
| Sorry, I wrote this without testing---always a mistake.
| As of 4.0 we're doing something on Darwin that's not so hard to
| understand: the <math.h> form keeps the C99 macros from the system
| headers, and the <cmath> form gets rid of those macros and replaces
| them with a function template.
| I'm not sure whether it was intended for isnan to be so different in
| <math.h> and <cmath> (I still haven't seen a specification for how
| we're trying to treat the C99 math macros), but what we're doing seems
| reasonably sane and defensible to me.
No one in the C++ standard, but one that follows or tries to follow
the TR1 math recommandation. Notice that std::isnan() is not
unconditionally defined as a function. It gets defined only if the
compiler is configured with C99 support (which is the default on some
systems). If not, you get it only in __gnu_cxx.