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
This commit is contained in:
Pádraig Brady committed 2019-02-10 20:32:59 -08:00
1 parent 03fbb5ecec
commit 2193e0b9fb
5 files changed
+7 -26

No files matched your search

-2
View 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
+1 -6
View File
@@ -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
+1 -1
Submodule gnulib updated: 8da562a8ae...341723e1b8.
+5 -13
View 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)
-4
View File
@@ -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