This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

std::isinfinite


Hi,

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

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]