2024-07-23 Bruno Haible <bruno@clisp.org>
+ strtod: Revisit underflow behaviour.
+ * doc/posix-functions/strtod.texi: Mention the macOS bug. Mention that
+ gradual underflow does not count as an error on Cygwin 2.9 and MSVC.
+ * m4/strtod.m4 (gl_FUNC_STRTOD): Update comment.
+
strtof: Revisit underflow behaviour.
* doc/posix-functions/strtof.texi: Mention the macOS bug. Mention the
mingw overflow bug. Mention the underflow bugs on Cygwin 2.9 and mingw.
@item
This function fails to parse @samp{NaN()} on some platforms:
-glibc-2.3.6, Mac OS X 10.5, FreeBSD 6.2, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, Cygwin < 1.5.25-11, mingw, MSVC 14.
+glibc 2.3.6, Mac OS X 10.5, FreeBSD 6.2, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, Cygwin < 1.5.25-11, mingw, MSVC 14.
@item
This function fails to parse @samp{NaN(@var{n-char-sequence})} on some
@item
This function parses @samp{NaN(@var{n-char-sequence})}, but returns
the wrong end pointer on some platforms:
-glibc-2.4, AIX 7.1.
+glibc 2.4, AIX 7.1.
+
+@item
+This function misparses @samp{nan(} on some platforms:
+macOS 10.6.6.
@item
This function fails to parse C99 hexadecimal floating point on some
This function returns the wrong end pointer for @samp{0x1p} on some
platforms:
AIX 7.1.
+
+@item
+@c The term "underflow", as defined by ISO C23 ยง 7.12.1.(6), includes both
+@c "gradual underflow" (result is a denormalized number) and "flush-to-zero
+@c underflow" (result is zero).
+This function fails to set @code{errno} upon gradual underflow (resulting
+in a denormalized number) on some platforms:
+Cygwin 2.9.
@end itemize
Portability problems fixed by Gnulib module @code{strtod-obsolete}:
platforms:
Mac OS X 10.5, FreeBSD 6.2, NetBSD 5.0, OpenBSD 4.0, Cygwin, mingw, MSVC 14.
+@item
+This function fails to set @code{errno} upon gradual underflow (resulting
+in a denormalized number) on some platforms:
+MSVC 14.
+
@item
The replacement function does not always return correctly rounded results.
@end itemize
# strtod.m4
-# serial 30
+# serial 31
dnl Copyright (C) 2002-2003, 2006-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
result |= 16;
}
{
- /* darwin 10.6.1 misparses "nan(". */
+ /* Darwin 10.6.1 (macOS 10.6.6) misparses "nan(". */
const char *string = "nan(";
char *term;
double value = strtod (string, &term);