Mateusz Loskot
Sat Sep 30 18:41:00 GMT 2006


I'd like to ask, why libstdc++ for GCC 4.0.3 declares
isfinite() in std:: namespaces?

I see in cmath headers, there is following definition:

isfinite(_Tp __f) { return __gnu_cxx::__capture_isfinite(__f); }

There is also a comment in the file saying:

(...) remove possible C99-injected names from the global namespace, and
sequester them in the __gnu_cxx extension namespace.(...)

Does is mean  __gnu_cxx extensions are pushed into std:: namespace?

I'd be thankful for some enlightenment.

Also, what's the best practice to avoid C99 extensions from
GCC/libstdc++, when compiling C++ portable code / C++ standard compliant.

Unfortunately, following compilation options do not prevent from using
isfinite() function, a C99-based extension as I understand.

g++ -Wall -pedantic -ansi -std=c++98 isinfinite.cpp

Mateusz Loskot

More information about the Libstdc++ mailing list