Broken numeric_limits<> in GCC3.2 (aka SuSE8.1)
Dear All, I recently compiled some important numeric applications I have under SuSE8.1 I was shocked to find that some of the major compiler/host config for GCC3.2 has not been done! The problem can be reproduced with the simple test program. #include <limits> #include <iostream> int main() { std::cout << std::numeric_limits<float>::has_infinity << std::endl; std::cout << std::numeric_limits<float>::infinity() << std::endl; } The problem is common to all the type traits, not just infinity, and all the real types, not just float. Looking in /usr/include/g++/limits the "__glibcpp_float_XXX" macro's control this behaviour. The macros appear in the context of the following lines in the header. // FIXME: These are just stubs and inkorrect #ifndef __glibcpp_float_infinity #define __glibcpp_float_infinity 0.0 #endif etc. Clearly SuSE has not completed the compiler/host config for GCC3.2 Looking in /usr/include/g++/i486-suse-linux/bits the header c++config.h provides no more useful definition for the "__glibcpp_float_XXX" macros. Can anyone else confirm this. Or indeed confirm this has been fixed! Given that non of these numeric_limits are defined in the distributed GCC package, I assume they were also not correctly defined when the other packages in the distro were compiled. I wonder if the numeric results from any of the packages using C++ are effected! Michael Stevens
Michael Stevens <Michael.Stevens@epost.de> [10 Mar 2003 20:52:30 +0100]:
I recently compiled some important numeric applications I have under SuSE8.1 I was shocked to find that some of the major compiler/host config for GCC3.2 has not been done!
If you really think this is a bug, please use http://feedback.suse.com to send a bug report to SuSE. Philipp -- Philipp Thomas work: pthomas@suse.de Development SuSE Linux AG private: pth@t-link.de
* Michael Stevens (Michael.Stevens@epost.de) [20030310 20:52]:
The problem can be reproduced with the simple test program.
#include <limits> #include <iostream>
int main() { std::cout << std::numeric_limits<float>::has_infinity << std::endl; std::cout << std::numeric_limits<float>::infinity() << std::endl; }
See http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3865 , which btw. uses the exact same test program. As you see fropm the audit trail, it was decided that this would not be fixed as it isn't a regression. 3.2 basically is 3.1 with a new API, and does _not_ have a fully standard conforming C++ library. You simply see one of the missing things.
Clearly SuSE has not completed the compiler/host config for GCC3.2
This is a generic GCC 3.2 problem, not a specific SuSE one. GCC 3.2 simply does not include full support. The GCC 3.3 that will come with SuSE Linux 8.2 will, among other things, have this fixed.
Given that non of these numeric_limits are defined in the distributed GCC package, I assume they were also not correctly defined when the other packages in the distro were compiled. I wonder if the numeric results from any of the packages using C++ are effected!
I really doubt there are any packages in the distribution that require numeric_limts<> support as gcc 2.95.x was even worse in implementing these. Philipp -- Philipp Thomas <pthomas@suse.de> SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nuremberg, Germany
Philipp Thomas wrote:
See http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3865 This is a generic GCC 3.2 problem, not a specific SuSE one. GCC 3.2 simply does not include full support. The GCC 3.3 that will come with SuSE Linux 8.2 will, among other things, have this fixed.
I really doubt there are any packages in the distribution that require numeric_limts<> support as gcc 2.95.x was even worse in implementing these.
GNU Scientific Library? I had some problems recently when I tried using numeric limits with GSL IEEE floating point support (SuSE 8.0). In the end, this really wasn't the way to do it. I found this response very helpful. I presume GSL will still be in 8.2, though it's pretty easy to compile from source. -- JDL
participants (4)
-
John Lamb
-
Michael Stevens
-
Philipp Thomas
-
Philipp Thomas