Re: 8.0.0beta1: make check fails on solaris8 - Mailing list pgsql-bugs

From Tom Lane
Subject Re: 8.0.0beta1: make check fails on solaris8
Date
Msg-id 14320.1092244966@sss.pgh.pa.us
Whole thread Raw
In response to Re: 8.0.0beta1: make check fails on solaris8  (Michael Fuhr <mike@fuhr.org>)
Responses Re: 8.0.0beta1: make check fails on solaris8
List pgsql-bugs
I've applied the attached patch to try to fix this problem with minimal
run-time cost.  Since I don't have a Solaris machine I can't positively
confirm it works --- would one of you please test?

            regards, tom lane


*** src/backend/utils/adt/float.c.orig    Wed Aug  4 17:34:02 2004
--- src/backend/utils/adt/float.c    Wed Aug 11 13:16:58 2004
***************
*** 317,322 ****
--- 317,334 ----
                       errmsg("invalid input syntax for type real: \"%s\"",
                              orig_num)));
      }
+ #ifdef HAVE_BUGGY_SOLARIS_STRTOD
+     else
+     {
+         /*
+          * Many versions of Solaris have a bug wherein strtod sets endptr
+          * to point one byte beyond the end of the string when given
+          * "inf" or "infinity".
+          */
+         if (endptr != num && endptr[-1] == '\0')
+             endptr--;
+     }
+ #endif /* HAVE_BUGGY_SOLARIS_STRTOD */

      /* skip trailing whitespace */
      while (*endptr != '\0' && isspace((unsigned char) *endptr))
***************
*** 482,487 ****
--- 494,511 ----
                       errmsg("invalid input syntax for type double precision: \"%s\"",
                              orig_num)));
      }
+ #ifdef HAVE_BUGGY_SOLARIS_STRTOD
+     else
+     {
+         /*
+          * Many versions of Solaris have a bug wherein strtod sets endptr
+          * to point one byte beyond the end of the string when given
+          * "inf" or "infinity".
+          */
+         if (endptr != num && endptr[-1] == '\0')
+             endptr--;
+     }
+ #endif /* HAVE_BUGGY_SOLARIS_STRTOD */

      /* skip trailing whitespace */
      while (*endptr != '\0' && isspace((unsigned char) *endptr))
*** src/include/port/solaris.h.orig    Sun Mar 14 22:29:22 2004
--- src/include/port/solaris.h    Wed Aug 11 13:16:50 2004
***************
*** 35,37 ****
--- 35,44 ----
  #define         BYTE_ORDER         LITTLE_ENDIAN
  #endif
  #endif
+
+ /*
+  * Many versions of Solaris have broken strtod() --- see bug #4751182.
+  * For the moment we just assume they all do; it's probably not worth
+  * the trouble to add a configure test for this.
+  */
+ #define HAVE_BUGGY_SOLARIS_STRTOD

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: 8.0.0beta1: make check fails on solaris8
Next
From: Tom Lane
Date:
Subject: Re: BUG #1212: 8.0.0beta1 build fails with bundled cc compiler