From: Pádraig Brady
Date: Mon, 11 Feb 2019 03:25:22 +0000 (-0800) Subject: gnulib: update to use new strtold module X-Git-Tag: v8.31~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2193e0b9fbf5efff14b20fbaaab41152a4887967;p=thirdparty%2Fcoreutils.git gnulib: update to use new strtold module * gnulib: Update to make the new strtold module available. * bootstrap.conf: strtod is now a dependency of c-strtod, which in turn is a dependency of cl-strtod. This treats strtold and strtod similarly. * gl/lib/cl-strtod.c: Adjust to assume strtold is available. * tests/misc/sort-float.sh: Likewise. * src/sort.c: Likewise. (nan_compare): Adjust comment to indicate we still have to init padding bits as per https://sourceware.org/bugzilla/show_bug.cgi?id=13246 --- diff --git a/bootstrap.conf b/bootstrap.conf index fb36918428..a525ef4422 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -40,7 +40,6 @@ gnulib_modules=" base64 buffer-lcm c-strcase - c-strtod cl-strtod cl-strtold calloc-gnu @@ -241,7 +240,6 @@ gnulib_modules=" strncat strnumcmp strsignal - strtod strtoimax strtoumax symlinkat diff --git a/gl/lib/cl-strtod.c b/gl/lib/cl-strtod.c index 998c2ef678..b4d9c5c55a 100644 --- a/gl/lib/cl-strtod.c +++ b/gl/lib/cl-strtod.c @@ -30,16 +30,11 @@ # define CL_STRTOD cl_strtold # define DOUBLE long double # define C_STRTOD c_strtold +# define STRTOD strtold #else # define CL_STRTOD cl_strtod # define DOUBLE double # define C_STRTOD c_strtod -#endif - -/* fall back on strtod if strtold doesn't conform to C99. */ -#if LONG && HAVE_C99_STRTOLD -# define STRTOD strtold -#else # define STRTOD strtod #endif diff --git a/gnulib b/gnulib index 8da562a8ae..341723e1b8 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 8da562a8ae58c5924b560c57e0e2bd88156ac9bd +Subproject commit 341723e1b879d70a08afdf4d8c566606f267e081 diff --git a/src/sort.c b/src/sort.c index c9191c2086..5ab363f8c4 100644 --- a/src/sort.c +++ b/src/sort.c @@ -96,14 +96,6 @@ struct rlimit { size_t rlim_cur; }; #define UCHAR_LIM (UCHAR_MAX + 1) -#if HAVE_C99_STRTOLD -# define long_double long double -#else -# define long_double double -# undef strtold -# define strtold strtod -#endif - #ifndef DEFAULT_TMPDIR # define DEFAULT_TMPDIR "/tmp" #endif @@ -2011,16 +2003,16 @@ numcompare (char const *a, char const *b) /* Work around a problem whereby the long double value returned by glibc's strtold ("NaN", ...) contains uninitialized bits: clear all bytes of - A and B before calling strtold. FIXME: remove this function once + A and B before calling strtold. FIXME: remove this function if gnulib guarantees that strtold's result is always well defined. */ static int nan_compare (char const *sa, char const *sb) { - long_double a; + long double a; memset (&a, 0, sizeof a); a = strtold (sa, NULL); - long_double b; + long double b; memset (&b, 0, sizeof b); b = strtold (sb, NULL); @@ -2035,8 +2027,8 @@ general_numcompare (char const *sa, char const *sb) char *ea; char *eb; - long_double a = strtold (sa, &ea); - long_double b = strtold (sb, &eb); + long double a = strtold (sa, &ea); + long double b = strtold (sb, &eb); /* Put conversion errors at the start of the collating sequence. */ if (sa == ea) diff --git a/tests/misc/sort-float.sh b/tests/misc/sort-float.sh index 0a9616dcfa..9aa2fd2af2 100755 --- a/tests/misc/sort-float.sh +++ b/tests/misc/sort-float.sh @@ -57,10 +57,6 @@ for LOC in C $LOCALE_FR; do LC_ALL=$LOC getlimits_ - # See if sort should be using long doubles - grep '^#define HAVE_C99_STRTOLD 1' $CONFIG_HEADER > /dev/null || - { LDBL_MAX="$DBL_MAX"; LDBL_MIN="$DBL_MIN"; } - # If DBL_MIN happens to be smaller than LDBL_MIN, swap them, # so that out expected output is sorted. if test $reversed = 1; then