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

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-05 
22:46:39 UTC ---
Just wanted to add that the real reason the issue is more subtle now in C++0x
mode than it used to be (and still is) in C++03 mode as an extension, is that
we now provide the functions in namespace std with the mandated return type,
that is bool, whereas in C++03 mode, as an extension, the return type is int,
like in C99. Frankly, *given* the usual, well known, limits of our way of
dealing with the underlying *.h C headers (included as implementation detail
anyway), I don't see any reasonably simple way of solving this family of
problems.

Actually, anyway, modulo a C++ front-end issue I filed some time ago, I think
the <cmath> header isn't *that* far from dispensing with including math.h, the
most important blocking issue being the constants FP_NAN, FP_INFINITE,
FP_NORMAL, FP_SUBNORMAL, FP_ZERO, which, the last time I asked, Joseph, if I
remember correctly, said are very tricky to obtain outside math.h...

Anyway, given the different return types in C++0x and C99, the problem would
resurface quite unavoidably with:

#include <cmath>
#include <math.h>

using namespace std;

of course, if we only fix <cmath> still without fully controlling math.h. Don't
hold your breath ;)

Reply via email to