From 6322cb1d9579ab8e2fd66139aa6a0f342925b7f0 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 12 Aug 2020 09:09:02 +0200 Subject: [PATCH 1/2] Remove obsolete HAVE_BUGGY_SOLARIS_STRTOD Fixed more than 10 years ago. --- src/backend/utils/adt/float.c | 24 ------------------------ src/include/port/solaris.h | 12 ------------ 2 files changed, 36 deletions(-) diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c index ffd1ce8c76..429c9280c0 100644 --- a/src/backend/utils/adt/float.c +++ b/src/backend/utils/adt/float.c @@ -271,18 +271,6 @@ float4in(PG_FUNCTION_ARGS) errmsg("invalid input syntax for type %s: \"%s\"", "real", 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)) @@ -499,18 +487,6 @@ float8in_internal_opt_error(char *num, char **endptr_p, type_name, orig_string))), have_error); } -#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)) diff --git a/src/include/port/solaris.h b/src/include/port/solaris.h index eeb1a320bd..e63a3bd824 100644 --- a/src/include/port/solaris.h +++ b/src/include/port/solaris.h @@ -24,15 +24,3 @@ #if defined(__i386__) #include #endif - -/* - * Many versions of Solaris have broken strtod() --- see bug #4751182. - * This has been fixed in current versions of Solaris: - * - * http://sunsolve.sun.com/search/document.do?assetkey=1-21-108993-62-1&searchclause=108993-62 - * http://sunsolve.sun.com/search/document.do?assetkey=1-21-112874-34-1&searchclause=112874-34 - * - * However, many people might not have patched versions, so - * still use our own fix for the buggy version. - */ -#define HAVE_BUGGY_SOLARIS_STRTOD -- 2.28.0