This is the mail archive of the mailing list for the GCC 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]

[PATCH] Fix PR libstdc++/31836 on hppa64-hp-hpux11.11

The following change fixes PR libstdc++/31836.  This is a regression
caused by switching from _GLIBCXX_USE_C99 to _GLIBCXX_HAVE_STRTOLD.
PA HP-UX has strtold, but it is an early version and doesn't conform
to C99 semantics.  This leads to the failure of

Tested on hppa2.0w-hp-hpux11.11.  Steve Ellcey checked and 11.23 and
11.31 still have the same semantics.  Thus, I don't believe a configure
test is needed.

Ok for trunk?

J. David Anglin                        
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2007-07-24  John Davind Anglin  <>

	PR libstdc++/31836
	* config/locale/generic/ (__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.

Index: config/locale/generic/
--- config/locale/generic/	(revision 126644)
+++ config/locale/generic/	(working copy)
@@ -149,7 +149,7 @@
       errno = 0;
       char* __sanity;
       long double __ld = strtold(__s, &__sanity);
Index: config/os/hpux/os_defines.h
--- config/os/hpux/os_defines.h	(revision 126644)
+++ config/os/hpux/os_defines.h	(working copy)
@@ -97,4 +97,12 @@
    are weak; gthread relies on such unsatisfied references being resolved
    to null pointers when weak symbol support is on.  */
+// 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__)

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