This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3876: c++ #define INFINITY in cmath
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: c++/3876: c++ #define INFINITY in cmath
- From: Ross Smith <ross dot s at ihug dot co dot nz>
- Date: Tue, 31 Jul 2001 11:04:39 +1200
- Organization: Ihug
- References: <20010730205234.23492.qmail@sourceware.cygnus.com>
aoliva@gcc.gnu.org wrote:
>
> Synopsis: c++ #define INFINITY in cmath
>
> State-Changed-From-To: open->closed
> State-Changed-By: aoliva
> State-Changed-When: Mon Jul 30 13:52:34 2001
> State-Changed-Why:
> INFINITY is specified as a macro in math.h in the C99 Standard,
> and the C++98 Standard says the contents of <cmath> are the same as
> those of <math.h> in the C Standard.
No, it says it's the same as <math.h> in the _C89_ standard. The C++
standard explicitly includes the C89 standard, not whichever version of
the C standard happens to be current at any particular time. A <cmath>
header that defines INFINITY is in violation of the C++ standard,
regardless of what C99 has to say about it.
> this is not a problem in GCC, but in glibc, which is
> where the definition of the macro comes from.
That's true, of course.
--
Ross Smith <ross.s@ihug.co.nz> The Internet Group, Auckland, New Zealand
========================================================================
"Unix has always lurked provocatively in the background of the operating
system wars, like the Russian Army." -- Neal Stephenson