[Bug libstdc++/14608] <iostream.h> nukes isfinite macro from <math.h>

zack at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Wed Mar 17 09:50:00 GMT 2004


------- Additional Comments From zack at codesourcery dot com  2004-03-17 09:50 -------
Subject: (PR 14608) [Dennis Handly] RE: Problem with GCC/G++ on HP-UX -
 v3.3.2prerelease - iostream/math.h


Further comments from the customer ...

>From: "Zack Weinberg" <zack@codesourcery.com>
>Dennis is not far off.  What's happening is that <iostream> includes
><cmath>.  <cmath> includes <math.h> and then #undefs a bunch of macros
>that a strict reading of C++98 disallows, including "isfinite".

Strict reading of C++98 would also disallow you undefing user macros
just to make the namespace clean.

I.e. suppose the user defined isfinite and you undefed it.
And if _HPUX_SOURCE is defined, (to get isfinite) you shouldn't undef it.

Unless you are very clever and check the definition before you include
<cmath> and only undef it if it wasn't defined.

Basically HP-UX never has defined a C++ clean namespace and unless
you can get the HP-UX people involved, you doing it by yourself is a
lost cause.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14608



More information about the Gcc-bugs mailing list