]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
gnulib: update to use new strtold module
authorPádraig Brady <P@draigBrady.com>
Mon, 11 Feb 2019 03:25:22 +0000 (19:25 -0800)
committerPádraig Brady <P@draigBrady.com>
Mon, 11 Feb 2019 04:32:59 +0000 (20:32 -0800)
* 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

bootstrap.conf
gl/lib/cl-strtod.c
gnulib
src/sort.c
tests/misc/sort-float.sh

index fb36918428fda26dd61a2aef2229bdcb7f6dcab8..a525ef44222ceb28d91e9b61ff5aedda23fd4ebf 100644 (file)
@@ -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
index 998c2ef67891ade1c51b7350a197062212ecfce7..b4d9c5c55aa462124e689f5d27152b1e0050be0b 100644 (file)
 # 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 8da562a8ae58c5924b560c57e0e2bd88156ac9bd..341723e1b879d70a08afdf4d8c566606f267e081 160000 (submodule)
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 8da562a8ae58c5924b560c57e0e2bd88156ac9bd
+Subproject commit 341723e1b879d70a08afdf4d8c566606f267e081
index c9191c20863f14c4db46cc1a590ff2281a17876f..5ab363f8c4fc9eea44d24995261596e784ad3c1e 100644 (file)
@@ -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)
index 0a9616dcfaa9c5d8cca7e008bbd260f3f9b4ccc0..9aa2fd2af22d0597d2499cf66ced9a92eff2a159 100755 (executable)
@@ -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