This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: C++ header file problem - is this a bug?
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Matt Austern <austern at apple dot com>
- Cc: Bill Northcott <w dot northcott at unsw dot edu dot au>, Dave Korn <dave dot korn at artimi dot com>, Andrew Pinski <pinskia at physics dot uc dot edu>, gcc at gcc dot gnu dot org, JAGS <jags at iarc dot fr>, libstdc++ at gcc dot gnu dot org
- Date: 10 Jan 2005 22:49:25 +0100
- Subject: Re: C++ header file problem - is this a bug?
- Organization: Integrable Solutions
- References: <NUTMEG8fBPaMkYwEoNc00000c22@NUTMEG.CAM.ARTIMI.COM><51BC97D0-5EDE-11D9-97FA-000393D3D676@unsw.edu.au><054C70C7-2171-42B1-98CA-927C90EA8EC0@apple.com><668AC020-FD25-458D-BE28-05730DED99EB@apple.com>
Matt Austern <austern@apple.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.
-- Gaby