c++/3876: c++ #define INFINITY in cmath

Gabriel Dos Reis gdr@codesourcery.com
Mon Jul 30 19:25:00 GMT 2001


Ross Smith <ross.s@ihug.co.nz> writes:

| 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.

Completely agreed, but here the definition of INIFNITY is not under my
control :-(

-- Gaby



More information about the Gcc-bugs mailing list