* doc/*-functions/*printf.texi: Update info regarding %a directive.
* m4/printf.m4 (gl_PRINTF_DIRECTIVE_A): Likewise. Improve bits
assignment in return value.
+2024-06-24 Bruno Haible <bruno@clisp.org>
+
+ doc: Update info about *printf.
+ * doc/*-functions/*printf.texi: Update info regarding %a directive.
+ * m4/printf.m4 (gl_PRINTF_DIRECTIVE_A): Likewise. Improve bits
+ assignment in return value.
+
2024-06-24 Bruno Haible <bruno@clisp.org>
doc: Update info about obstack_*printf.
@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 10.0, OpenBSD 4.0, Solaris 11.4, Cygwin 1.5.x.
+FreeBSD 5.2.1, OpenBSD 4.0, Solaris 11.4, Cygwin 1.5.x.
@item
This function does not support the @samp{b} directive, required by ISO C23,
on some platforms:
@item
This function does not round the argument of the @samp{a} directive correctly
on some platforms:
-macOS 14, FreeBSD 14.0.
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes) on some platforms:
@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
-glibc-2.3.6, NetBSD 10.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+FreeBSD 5.2.1, OpenBSD 4.0, AIX 5.2, HP-UX 11,
Solaris 11.4, Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{b} directive, required by ISO C23,
@item
This function does not round the argument of the @samp{a} directive correctly
on some platforms:
-Mac OS X 10.12, FreeBSD 6.1.
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes) on some platforms:
@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
-glibc-2.3.6, NetBSD 10.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+FreeBSD 5.2.1, OpenBSD 4.0, AIX 5.2, HP-UX 11,
Solaris 11.4, Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{b} directive, required by ISO C23,
@item
This function does not round the argument of the @samp{a} directive correctly
on some platforms:
-Mac OS X 10.12, FreeBSD 6.1.
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes) on some platforms:
@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 10.0, OpenBSD 4.0, Solaris 11.4, Cygwin 1.5.x.
+FreeBSD 5.2.1, OpenBSD 4.0, Solaris 11.4, Cygwin 1.5.x.
@item
This function does not support the @samp{b} directive, required by ISO C23,
on some platforms:
@item
This function does not round the argument of the @samp{a} directive correctly
on some platforms:
-macOS 14, FreeBSD 14.0.
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes) on some platforms:
@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
-glibc-2.3.6, Solaris 11.4.
+Solaris 11.4.
@item
This function does not support the @samp{b} directive, required by ISO C23,
on some platforms:
on some platforms:
Solaris 11.4.
@item
+This function does not round the argument of the @samp{a} directive correctly
+on some platforms:
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
+@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes, or wrong capitalization) on some platforms:
Solaris 11.4.
@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 10.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+FreeBSD 5.2.1, OpenBSD 4.0, AIX 5.2, HP-UX 11,
Solaris 11.4, Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{b} directive, required by ISO C23,
@item
This function does not round the argument of the @samp{a} directive correctly
on some platforms:
-macOS 14, FreeBSD 14.0.
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes, or wrong capitalization) on some platforms:
@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 10.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+FreeBSD 5.2.1, OpenBSD 4.0, AIX 5.2, HP-UX 11,
Solaris 11.4, Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{b} directive, required by ISO C23,
@item
This function does not round the argument of the @samp{a} directive correctly
on some platforms:
-macOS 14, FreeBSD 14.0.
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes, or wrong capitalization) on some platforms:
@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 10.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+FreeBSD 5.2.1, OpenBSD 4.0, AIX 5.2, HP-UX 11,
Solaris 11.4, Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{b} directive, required by ISO C23,
@item
This function does not round the argument of the @samp{a} directive correctly
on some platforms:
-macOS 14, FreeBSD 14.0.
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes, or wrong capitalization) on some platforms:
@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 10.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+FreeBSD 5.2.1, OpenBSD 4.0, AIX 5.2, HP-UX 11,
Solaris 11.4, Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{b} directive, required by ISO C23,
@item
This function does not round the argument of the @samp{a} directive correctly
on some platforms:
-macOS 14, FreeBSD 14.0.
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes, or wrong capitalization) on some platforms:
@item
This function does not support the @samp{a} and @samp{A} directives on some
platforms:
-glibc-2.3.6, Solaris 11.4.
+Solaris 11.4.
@item
This function does not support the @samp{b} directive, required by ISO C23,
on some platforms:
on some platforms:
Solaris 11.4.
@item
+This function does not round the argument of the @samp{a} directive correctly
+on some platforms:
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
+@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes, or wrong capitalization) on some platforms:
Solaris 11.4.
@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 10.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+FreeBSD 5.2.1, OpenBSD 4.0, AIX 5.2, HP-UX 11,
Solaris 11.4, Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{b} directive, required by ISO C23,
@item
This function does not round the argument of the @samp{a} directive correctly
on some platforms:
-macOS 14, FreeBSD 14.0.
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes, or wrong capitalization) on some platforms:
@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 10.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+FreeBSD 5.2.1, OpenBSD 4.0, AIX 5.2, HP-UX 11,
Solaris 11.4, Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{b} directive, required by ISO C23,
@item
This function does not round the argument of the @samp{a} directive correctly
on some platforms:
-macOS 14, FreeBSD 14.0.
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes, or wrong capitalization) on some platforms:
@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 10.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+FreeBSD 5.2.1, OpenBSD 4.0, AIX 5.2, HP-UX 11,
Solaris 11.4, Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{b} directive, required by ISO C23,
@item
This function does not round the argument of the @samp{a} directive correctly
on some platforms:
-macOS 14, FreeBSD 14.0.
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes, or wrong capitalization) on some platforms:
@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 10.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+FreeBSD 5.2.1, OpenBSD 4.0, AIX 5.2, HP-UX 11,
Solaris 11.4, Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{b} directive, required by ISO C23,
@item
This function does not round the argument of the @samp{a} directive correctly
on some platforms:
-macOS 14, FreeBSD 14.0.
+macOS 14, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.
@item
printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
with zeroes, or wrong capitalization) on some platforms:
# printf.m4
-# serial 93
+# serial 94
dnl Copyright (C) 2003, 2007-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,
int main ()
{
int result = 0;
+ /* This fails on FreeBSD 5.2.1, Solaris 11.4. */
if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
|| (strcmp (buf, "0x1.922p+1 33") != 0
&& strcmp (buf, "0x3.244p+0 33") != 0
&& strcmp (buf, "-0X3.244P+0 33") != 0
&& strcmp (buf, "-0X6.488P-1 33") != 0
&& strcmp (buf, "-0XC.91P-2 33") != 0))
- result |= 2;
- /* This catches a FreeBSD 13.0 bug: it doesn't round. */
+ result |= 1;
+ /* This catches a Mac OS X 10.5, FreeBSD 6.4, NetBSD 10.0 bug:
+ it doesn't round. */
if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
|| (strcmp (buf, "0x1.83p+0 33") != 0
&& strcmp (buf, "0x3.05p-1 33") != 0
&& strcmp (buf, "0x6.0ap-2 33") != 0
&& strcmp (buf, "0xc.14p-3 33") != 0))
- result |= 4;
- /* This catches a macOS 14 (Darwin 23) bug: it doesn't round. */
+ result |= 2;
+ /* This catches a macOS 14 (Darwin 23), FreeBSD 14.0, OpenBSD 7.5, AIX 7.3,
+ Solaris 11.4 bug: it doesn't round. */
if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0
|| (strcmp (buf, "0x2p+0 33") != 0
&& strcmp (buf, "0x3p-1 33") != 0
&& strcmp (buf, "0x6p-2 33") != 0
&& strcmp (buf, "0xcp-3 33") != 0))
result |= 4;
- /* This catches a FreeBSD 6.1 bug. See
+ /* This catches a Mac OS X 10.5, FreeBSD 6.4 bug. See
<https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
|| buf[0] == '0')
result |= 8;
- /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */
+ /* This catches a Mac OS X 10.3.9 (Darwin 7.9), FreeBSD 6.4 bug. */
if (sprintf (buf, "%.1a", 1.999) < 0
|| (strcmp (buf, "0x1.0p+1") != 0
&& strcmp (buf, "0x2.0p+0") != 0
&& strcmp (buf, "0x8.0p-2") != 0))
result |= 16;
/* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
- glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
+ glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>
+ and a FreeBSD 6.4, NetBSD 10.0 bug. */
if (sprintf (buf, "%.1La", 1.999L) < 0
|| (strcmp (buf, "0x1.0p+1") != 0
&& strcmp (buf, "0x2.0p+0") != 0