re PR libstdc++/31836 (FAIL: 27_io/basic_istream/extractors_arithmetic/char/12.cc...
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Wed, 25 Jul 2007 15:32:33 +0000 (15:32 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Wed, 25 Jul 2007 15:32:33 +0000 (15:32 +0000)
PR libstdc++/31836
* config/locale/generic/c_locale.cc (__convert_to_v): Don't use
strtold if _GLIBCXX_HAVE_BROKEN_STRTOLD is defined.
* config/os/hpux/os_defines.h (_GLIBCXX_HAVE_BROKEN_STRTOLD): Define
if __hppa__ is defined.

From-SVN: r126914

libstdc++-v3/ChangeLog
libstdc++-v3/config/locale/generic/c_locale.cc
libstdc++-v3/config/os/hpux/os_defines.h

index 7d2e07565db6bf5d4df516c536e8a4f6f3a14cdd..99d61538bc32d1452a695f719094733f67e33149 100644 (file)
@@ -1,3 +1,11 @@
+2007-07-25  John Davind Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR libstdc++/31836
+       * config/locale/generic/c_locale.cc (__convert_to_v): Don't use
+       strtold if _GLIBCXX_HAVE_BROKEN_STRTOLD is defined.
+       * config/os/hpux/os_defines.h (_GLIBCXX_HAVE_BROKEN_STRTOLD): Define
+       if __hppa__ is defined.
+
 2007-07-16  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
 
        PR bootstrap/3456
index 732b60955f4a98abd82410edcea40e949df0b66d..80cef2d8818bca532df4662195ca6de1d3911c9f 100644 (file)
@@ -149,7 +149,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       errno = 0;
 #endif
 
-#if defined(_GLIBCXX_HAVE_STRTOLD)
+#if defined(_GLIBCXX_HAVE_STRTOLD) && !defined(_GLIBCXX_HAVE_BROKEN_STRTOLD)
       char* __sanity;
       long double __ld = strtold(__s, &__sanity);
 
index c7ff485d2ddad0e6ddd2188bb90c097424345675..6118a2671dda57a5cfbb1cee3646b78e30e7cf1e 100644 (file)
@@ -97,4 +97,12 @@ typedef long int __padding_type;
    are weak; gthread relies on such unsatisfied references being resolved
    to null pointers when weak symbol support is on.  */
 #define _GLIBCXX_GTHREAD_USE_WEAK 0
+
+// The strtold function is obsolete and not C99 conformant on PA HP-UX.
+// It returns plus or minus _LDBL_MAX instead of plus or minus HUGE_VALL
+// if the correct value would cause overflow.  It doesn't handle "inf",
+// "infinity" and "nan".  It is not thread safe. 
+#if defined (__hppa__)
+#define _GLIBCXX_HAVE_BROKEN_STRTOLD 1
+#endif
 #endif