summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-02-20 18:09:47 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-02-20 18:10:46 -0800
commitbd38edc81714fc2679b02ef34033f9e15954d32f (patch)
tree239b8fb6edeb8bac9c3bb8065cd152101ce04fd4 /doc
parent12d27cace7a75301f793527a57e5ae09ed73c4ba (diff)
downloadgnulib-bd38edc81714fc2679b02ef34033f9e15954d32f.tar.gz
printf, isinf, etc.: noncanonical != NaN
Do not require that isinf, printf, etc. treat noncanonical values as NaNs. Instead, require only that they do not crash. Problem reported by Joseph Myers in: https://sourceware.org/ml/libc-alpha/2015-02/msg00244.html * doc/posix-functions/dprintf.texi (dprintf): * doc/posix-functions/fprintf.texi (fprintf): * doc/posix-functions/isfinite.texi (isfinite): * doc/posix-functions/isinf.texi (isinf): * doc/posix-functions/isnan.texi (isnan): * doc/posix-functions/printf.texi (printf): * doc/posix-functions/snprintf.texi (snprintf): * doc/posix-functions/sprintf.texi (sprintf): * doc/posix-functions/vdprintf.texi (vdprintf): * doc/posix-functions/vfprintf.texi (vfprintf): * doc/posix-functions/vprintf.texi (vprintf): * doc/posix-functions/vsnprintf.texi (vsnprintf): * doc/posix-functions/vsprintf.texi (vsprintf): Document this. * m4/isfinite.m4 (gl_ISFINITEL_WORKS): * m4/isinf.m4 (gl_ISINFL_WORKS): * m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): * m4/printf.m4 (gl_PRINTF_INFINITE_LONG_DOUBLE): * tests/test-isfinite.c (test_isfinitel): * tests/test-isinf.c (test_isinfl): * tests/test-isnan.c (test_long_double): * tests/test-isnanl.h (main): * tests/test-snprintf-posix.h (test_function): * tests/test-sprintf-posix.h (test_function): * tests/test-vasnprintf-posix.c (test_function): * tests/test-vasprintf-posix.c (test_function): o Test only that noncanonical values do not cause crashes, not that they are treated as NaNs. In some cases this means a larger output buffer is needed.
Diffstat (limited to 'doc')
-rw-r--r--doc/posix-functions/dprintf.texi8
-rw-r--r--doc/posix-functions/fprintf.texi8
-rw-r--r--doc/posix-functions/isfinite.texi10
-rw-r--r--doc/posix-functions/isinf.texi8
-rw-r--r--doc/posix-functions/isnan.texi13
-rw-r--r--doc/posix-functions/printf.texi8
-rw-r--r--doc/posix-functions/snprintf.texi8
-rw-r--r--doc/posix-functions/sprintf.texi8
-rw-r--r--doc/posix-functions/vdprintf.texi8
-rw-r--r--doc/posix-functions/vfprintf.texi8
-rw-r--r--doc/posix-functions/vprintf.texi8
-rw-r--r--doc/posix-functions/vsnprintf.texi8
-rw-r--r--doc/posix-functions/vsprintf.texi8
13 files changed, 52 insertions, 59 deletions
diff --git a/doc/posix-functions/dprintf.texi b/doc/posix-functions/dprintf.texi
index 41b8e4424e..acc752cc00 100644
--- a/doc/posix-functions/dprintf.texi
+++ b/doc/posix-functions/dprintf.texi
@@ -17,10 +17,6 @@ IRIX 6.5, OSF/1 5.1, Solaris 11 2011-11, Cygwin 1.5.x, mingw, MSVC 9, Interix 3.
Portability problems fixed by Gnulib module @code{dprintf-posix}:
@itemize
@item
-printf of @samp{long double} numbers outside the IEEE 754 range produces
-no meaningful results on some platforms:
-glibc and others, on x86, x86_64, IA-64 CPUs.
-@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
glibc-2.3.6.
@@ -33,6 +29,10 @@ AIX 7.1.
Portability problems not fixed by Gnulib:
@itemize
@item
+Formatting noncanonical @samp{long double} numbers produces
+nonmeaningful results on some platforms:
+glibc and others, on x86, x86_64, IA-64 CPUs.
+@item
When formatting an integer with grouping flag, this function inserts thousands
separators even in the "C" locale on some platforms:
NetBSD 5.1.
diff --git a/doc/posix-functions/fprintf.texi b/doc/posix-functions/fprintf.texi
index 3916b3123f..f4a6d5e75d 100644
--- a/doc/posix-functions/fprintf.texi
+++ b/doc/posix-functions/fprintf.texi
@@ -20,10 +20,6 @@ printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an
incorrect result on some platforms:
AIX 5.2, OSF/1 5.1, Solaris 11 2011-11, mingw, MSVC 9.
@item
-printf of @samp{long double} numbers outside the IEEE 754 range produces
-no meaningful results on some platforms:
-glibc and others, on x86, x86_64, IA-64 CPUs.
-@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
glibc-2.3.6, Mac OS X 10.5, NetBSD 5.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
@@ -91,6 +87,10 @@ mingw, MSVC 9.
Portability problems not fixed by Gnulib:
@itemize
@item
+Formatting noncanonical @samp{long double} numbers produces
+nonmeaningful results on some platforms:
+glibc and others, on x86, x86_64, IA-64 CPUs.
+@item
When formatting an integer with grouping flag, this function inserts thousands
separators even in the "C" locale on some platforms:
NetBSD 5.1.
diff --git a/doc/posix-functions/isfinite.texi b/doc/posix-functions/isfinite.texi
index 3e6f3d8ee0..32fe0b86b5 100644
--- a/doc/posix-functions/isfinite.texi
+++ b/doc/posix-functions/isfinite.texi
@@ -15,12 +15,6 @@ Mac OS X 10.5, OpenBSD 3.8, AIX 5.1, IRIX 6.5, OSF/1 5.1, Solaris 11 2011-11, In
This macro incorrectly yields true for some @samp{double} arguments, on some
platforms:
Linux/ia64 (signalling NaNs).
-@item
-This macro incorrectly yields true for some @samp{long double} arguments, on
-some platforms:
-x86 (pseudo-zeroes, unnormalized numbers, pseudo-denormals),
-x86_64 (pseudo-denormals),
-ia64 (pseudo-NaN, pseudo-Infinity, pseudo-zeroes, unnormalized numbers, pseudo-denormals).
@end itemize
Portability problems not fixed by Gnulib:
@@ -28,4 +22,8 @@ Portability problems not fixed by Gnulib:
@item
It is implementation-dependent whether @code{isfinite} raises an
exception given a signaling NaN operand.
+@item
+This macro returns an unspecified result when given noncanonical values
+such as unnormalized numbers, pseudo-denormals, pseudo-NaNs,
+pseudo-Infinities, and pseudo-zeroes.
@end itemize
diff --git a/doc/posix-functions/isinf.texi b/doc/posix-functions/isinf.texi
index 2448d75706..848d1e6cc4 100644
--- a/doc/posix-functions/isinf.texi
+++ b/doc/posix-functions/isinf.texi
@@ -11,12 +11,12 @@ Portability problems fixed by Gnulib:
@item
This macro is missing on some platforms:
AIX 5.1, IRIX 6.5, OSF/1 5.1, Solaris 11 2011-11.
-@item
-This macro incorrectly yields true for some @samp{long double} arguments, on
-some platforms:
-OpenBSD 4.9/x86 (pseudo-Infinity).
@end itemize
Portability problems not fixed by Gnulib:
@itemize
+@item
+This macro returns an unspecified result when given noncanonical values
+such as unnormalized numbers, pseudo-denormals, pseudo-NaNs,
+pseudo-Infinities, and pseudo-zeroes.
@end itemize
diff --git a/doc/posix-functions/isnan.texi b/doc/posix-functions/isnan.texi
index 160b7a4627..f9ed11a6b5 100644
--- a/doc/posix-functions/isnan.texi
+++ b/doc/posix-functions/isnan.texi
@@ -19,17 +19,12 @@ on pre-C99 systems.
IRIX 6.5, OSF/1 5.1 with gcc, Solaris 11 2011-11.
@item
On IRIX 6.5 with @code{cc}, @code{isnan} does not recognize some NaNs.
-@item
-On NetBSD/i386 and glibc/ia64, @code{isnan} does not recognize some
-forms of NaNs, such as pseudo-NaNs, pseudo-Infinities, and
-unnormalized numbers.
-@item
-On i686 and @var{x}86-64, @code{__builtin_isnanl} (and thus
-@code{isnan} implementations based on it) in GCC 4.0 and later does
-not recognize pseudo-denormals as NaNs, and similarly for
-pseudo-zeroes, unnormalized numbers, and pseudo-denormals on ia64.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
+@item
+This macro returns an unspecified result when given noncanonical values
+such as unnormalized numbers, pseudo-denormals, pseudo-NaNs,
+pseudo-Infinities, and pseudo-zeroes.
@end itemize
diff --git a/doc/posix-functions/printf.texi b/doc/posix-functions/printf.texi
index b96dd95cd0..79537c973e 100644
--- a/doc/posix-functions/printf.texi
+++ b/doc/posix-functions/printf.texi
@@ -20,10 +20,6 @@ printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an
incorrect result on some platforms:
AIX 5.2, OSF/1 5.1, Solaris 11 2011-11, mingw, MSVC 9.
@item
-printf of @samp{long double} numbers outside the IEEE 754 range produces
-no meaningful results on some platforms:
-glibc and others, on x86, x86_64, IA-64 CPUs.
-@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
glibc-2.3.6, Mac OS X 10.5, NetBSD 5.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
@@ -91,6 +87,10 @@ mingw, MSVC 9.
Portability problems not fixed by Gnulib:
@itemize
@item
+Formatting noncanonical @samp{long double} numbers produces
+nonmeaningful results on some platforms:
+glibc and others, on x86, x86_64, IA-64 CPUs.
+@item
When formatting an integer with grouping flag, this function inserts thousands
separators even in the "C" locale on some platforms:
NetBSD 5.1.
diff --git a/doc/posix-functions/snprintf.texi b/doc/posix-functions/snprintf.texi
index 3d90c30d83..76c88fa193 100644
--- a/doc/posix-functions/snprintf.texi
+++ b/doc/posix-functions/snprintf.texi
@@ -39,10 +39,6 @@ printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an
incorrect result on some platforms:
AIX 5.2, OSF/1 5.1, Solaris 11 2011-11, mingw, MSVC 9.
@item
-printf of @samp{long double} numbers outside the IEEE 754 range produces
-no meaningful results on some platforms:
-glibc and others, on x86, x86_64, IA-64 CPUs.
-@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
glibc-2.3.6, Mac OS X 10.5, NetBSD 5.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
@@ -99,6 +95,10 @@ OSF/1 5.1.
Portability problems not fixed by Gnulib:
@itemize
@item
+Formatting noncanonical @samp{long double} numbers produces
+nonmeaningful results on some platforms:
+glibc and others, on x86, x86_64, IA-64 CPUs.
+@item
When formatting an integer with grouping flag, this function inserts thousands
separators even in the "C" locale on some platforms:
NetBSD 5.1.
diff --git a/doc/posix-functions/sprintf.texi b/doc/posix-functions/sprintf.texi
index b4c4549cfa..63b38bf8cb 100644
--- a/doc/posix-functions/sprintf.texi
+++ b/doc/posix-functions/sprintf.texi
@@ -20,10 +20,6 @@ printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an
incorrect result on some platforms:
AIX 5.2, OSF/1 5.1, Solaris 11 2011-11, mingw, MSVC 9.
@item
-printf of @samp{long double} numbers outside the IEEE 754 range produces
-no meaningful results on some platforms:
-glibc and others, on x86, x86_64, IA-64 CPUs.
-@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
glibc-2.3.6, Mac OS X 10.5, NetBSD 5.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
@@ -74,6 +70,10 @@ Mac OS X 10.3, FreeBSD 6.0, NetBSD 5.0.
Portability problems not fixed by Gnulib:
@itemize
@item
+Formatting noncanonical @samp{long double} numbers produces
+nonmeaningful results on some platforms:
+glibc and others, on x86, x86_64, IA-64 CPUs.
+@item
When formatting an integer with grouping flag, this function inserts thousands
separators even in the "C" locale on some platforms:
NetBSD 5.1.
diff --git a/doc/posix-functions/vdprintf.texi b/doc/posix-functions/vdprintf.texi
index 78e0f00bf6..72f4b9314e 100644
--- a/doc/posix-functions/vdprintf.texi
+++ b/doc/posix-functions/vdprintf.texi
@@ -24,10 +24,6 @@ BeOS.
printf of @samp{long double} numbers is unsupported on some platforms:
BeOS.
@item
-printf of @samp{long double} numbers outside the IEEE 754 range produces
-no meaningful results on some platforms:
-glibc and others, on x86, x86_64, IA-64 CPUs.
-@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
glibc-2.3.6, BeOS.
@@ -47,6 +43,10 @@ AIX 7.1, BeOS.
Portability problems not fixed by Gnulib:
@itemize
@item
+Formatting noncanonical @samp{long double} numbers produces
+nonmeaningful results on some platforms:
+glibc and others, on x86, x86_64, IA-64 CPUs.
+@item
When formatting an integer with grouping flag, this function inserts thousands
separators even in the "C" locale on some platforms:
NetBSD 5.1.
diff --git a/doc/posix-functions/vfprintf.texi b/doc/posix-functions/vfprintf.texi
index ea70658073..00f103fea9 100644
--- a/doc/posix-functions/vfprintf.texi
+++ b/doc/posix-functions/vfprintf.texi
@@ -20,10 +20,6 @@ printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an
incorrect result on some platforms:
AIX 5.2, OSF/1 5.1, Solaris 11 2011-11, mingw, MSVC 9.
@item
-printf of @samp{long double} numbers outside the IEEE 754 range produces
-no meaningful results on some platforms:
-glibc and others, on x86, x86_64, IA-64 CPUs.
-@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
glibc-2.3.6, Mac OS X 10.5, NetBSD 5.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
@@ -91,6 +87,10 @@ mingw, MSVC 9.
Portability problems not fixed by Gnulib:
@itemize
@item
+Formatting noncanonical @samp{long double} numbers produces
+nonmeaningful results on some platforms:
+glibc and others, on x86, x86_64, IA-64 CPUs.
+@item
When formatting an integer with grouping flag, this function inserts thousands
separators even in the "C" locale on some platforms:
NetBSD 5.1.
diff --git a/doc/posix-functions/vprintf.texi b/doc/posix-functions/vprintf.texi
index 72ab1040c5..a7bcf51d89 100644
--- a/doc/posix-functions/vprintf.texi
+++ b/doc/posix-functions/vprintf.texi
@@ -20,10 +20,6 @@ printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an
incorrect result on some platforms:
AIX 5.2, OSF/1 5.1, Solaris 11 2011-11, mingw, MSVC 9.
@item
-printf of @samp{long double} numbers outside the IEEE 754 range produces
-no meaningful results on some platforms:
-glibc and others, on x86, x86_64, IA-64 CPUs.
-@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
glibc-2.3.6, Mac OS X 10.5, NetBSD 5.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
@@ -91,6 +87,10 @@ mingw, MSVC 9.
Portability problems not fixed by Gnulib:
@itemize
@item
+Formatting noncanonical @samp{long double} numbers produces
+nonmeaningful results on some platforms:
+glibc and others, on x86, x86_64, IA-64 CPUs.
+@item
When formatting an integer with grouping flag, this function inserts thousands
separators even in the "C" locale on some platforms:
NetBSD 5.1.
diff --git a/doc/posix-functions/vsnprintf.texi b/doc/posix-functions/vsnprintf.texi
index 37923e1c7d..495647fac5 100644
--- a/doc/posix-functions/vsnprintf.texi
+++ b/doc/posix-functions/vsnprintf.texi
@@ -39,10 +39,6 @@ printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an
incorrect result on some platforms:
AIX 5.2, OSF/1 5.1, Solaris 11 2011-11, mingw, MSVC 9.
@item
-printf of @samp{long double} numbers outside the IEEE 754 range produces
-no meaningful results on some platforms:
-glibc and others, on x86, x86_64, IA-64 CPUs.
-@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
glibc-2.3.6, Mac OS X 10.5, NetBSD 5.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
@@ -96,6 +92,10 @@ HP-UX 11, OSF/1 5.1.
Portability problems not fixed by Gnulib:
@itemize
@item
+Formatting noncanonical @samp{long double} numbers produces
+nonmeaningful results on some platforms:
+glibc and others, on x86, x86_64, IA-64 CPUs.
+@item
When formatting an integer with grouping flag, this function inserts thousands
separators even in the "C" locale on some platforms:
NetBSD 5.1.
diff --git a/doc/posix-functions/vsprintf.texi b/doc/posix-functions/vsprintf.texi
index e329b6d26b..723e4d5010 100644
--- a/doc/posix-functions/vsprintf.texi
+++ b/doc/posix-functions/vsprintf.texi
@@ -20,10 +20,6 @@ printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an
incorrect result on some platforms:
AIX 5.2, OSF/1 5.1, Solaris 11 2011-11, mingw, MSVC 9.
@item
-printf of @samp{long double} numbers outside the IEEE 754 range produces
-no meaningful results on some platforms:
-glibc and others, on x86, x86_64, IA-64 CPUs.
-@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
glibc-2.3.6, Mac OS X 10.5, NetBSD 5.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
@@ -74,6 +70,10 @@ Mac OS X 10.3, FreeBSD 6.0, NetBSD 5.0.
Portability problems not fixed by Gnulib:
@itemize
@item
+Formatting noncanonical @samp{long double} numbers produces
+nonmeaningful results on some platforms:
+glibc and others, on x86, x86_64, IA-64 CPUs.
+@item
When formatting an integer with grouping flag, this function inserts thousands
separators even in the "C" locale on some platforms:
NetBSD 5.1.