summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-03-24 22:14:09 +0100
committerBruno Haible <bruno@clisp.org>2023-03-24 22:14:09 +0100
commit480a59ba60fa0b43a1cebe218bbcea6a947f1e86 (patch)
treeb2b3cdce131d3a52f876c652796d6477c1f758ec /doc
parentd4bf26d359cf758bee20b907352c5db68dda19d4 (diff)
downloadgnulib-480a59ba60fa0b43a1cebe218bbcea6a947f1e86.tar.gz
*printf-posix: ISO C 23: Support size specifiers 'wN' and 'wfN'.
* lib/printf-args.h: Include <stdint.h>. (arg_type): Add TYPE_[U]INT8_T, ..., TYPE_[U]INT_FAST64_T and TYPE_COUNT_INT8_T_POINTER, ..., TYPE_COUNT_INT_FAST64_T_POINTER. (argument): Add the union members a_[u]int8_t, ..., a_[u]int_fast64_t and a_count_int8_t_pointer, ..., a_count_int_fast64_t_pointer. * lib/printf-args.c: Include <limits.h>. (PRINTF_FETCHARGS): Handle TYPE_[U]INT8_T, ..., TYPE_[U]INT_FAST64_T and TYPE_COUNT_INT8_T_POINTER, ..., TYPE_COUNT_INT_FAST64_T_POINTER. * lib/printf-parse.c (PRINTF_PARSE): Accept only one size specifier, not a sequence of size specifiers. Accept "wN" and "wfN", where N = 8, 16, 32, 64. * lib/vasnprintf.c (MAX_ROOM_NEEDED, VASNPRINTF): Handle the new TYPE_* values as well. * m4/printf.m4 (gl_PRINTF_SIZES_C23): New macro. * m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_IS_POSIX): Require gl_PRINTF_SIZES_C23. Test gl_cv_func_printf_sizes_c23. * m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_IS_POSIX): Likewise. * m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_IS_POSIX): Likewise. * m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_IS_POSIX): Likewise. * m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_IS_POSIX): Likewise. * m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_IS_POSIX): Likewise. * m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_IS_POSIX): Likewise. * m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_IS_POSIX): Likewise. * m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_IS_POSIX): Likewise. * m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_IS_POSIX): Likewise. * m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_IS_POSIX): Likewise. * tests/test-vasnprintf-posix.c (test_function): Add tests for size specifiers with %d, %u, %b, %o, %x. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnwprintf-posix.c (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise. * modules/vasnprintf (Depends-on): Add limits-h. * modules/vasnwprintf (Depends-on): Add limits-h. * modules/c-vasnprintf (Depends-on): Add limits-h, stdint. * modules/unistdio/u-printf-args (Depends-on): Add stdint, limits-h. * doc/posix-functions/dprintf.texi: Mention the ISO C 23 size specifiers. * doc/posix-functions/fprintf.texi: Likewise. * doc/posix-functions/fwprintf.texi: Likewise. * doc/posix-functions/printf.texi: Likewise. * doc/posix-functions/snprintf.texi: Likewise. * doc/posix-functions/sprintf.texi: Likewise. * doc/posix-functions/swprintf.texi: Likewise. * doc/posix-functions/vdprintf.texi: Likewise. * doc/posix-functions/vfprintf.texi: Likewise. * doc/posix-functions/vfwprintf.texi: Likewise. * doc/posix-functions/vprintf.texi: Likewise. * doc/posix-functions/vsnprintf.texi: Likewise. * doc/posix-functions/vsprintf.texi: Likewise. * doc/posix-functions/vswprintf.texi: Likewise. * doc/posix-functions/vwprintf.texi: Likewise. * doc/posix-functions/wprintf.texi: Likewise.
Diffstat (limited to 'doc')
-rw-r--r--doc/posix-functions/dprintf.texi6
-rw-r--r--doc/posix-functions/fprintf.texi6
-rw-r--r--doc/posix-functions/fwprintf.texi6
-rw-r--r--doc/posix-functions/printf.texi6
-rw-r--r--doc/posix-functions/snprintf.texi6
-rw-r--r--doc/posix-functions/sprintf.texi6
-rw-r--r--doc/posix-functions/swprintf.texi6
-rw-r--r--doc/posix-functions/vdprintf.texi6
-rw-r--r--doc/posix-functions/vfprintf.texi6
-rw-r--r--doc/posix-functions/vfwprintf.texi6
-rw-r--r--doc/posix-functions/vprintf.texi6
-rw-r--r--doc/posix-functions/vsnprintf.texi6
-rw-r--r--doc/posix-functions/vsprintf.texi6
-rw-r--r--doc/posix-functions/vswprintf.texi6
-rw-r--r--doc/posix-functions/vwprintf.texi6
-rw-r--r--doc/posix-functions/wprintf.texi6
16 files changed, 96 insertions, 0 deletions
diff --git a/doc/posix-functions/dprintf.texi b/doc/posix-functions/dprintf.texi
index 54953d04a3..2f90377590 100644
--- a/doc/posix-functions/dprintf.texi
+++ b/doc/posix-functions/dprintf.texi
@@ -16,6 +16,12 @@ Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX
Portability problems fixed by either Gnulib module @code{dprintf-posix} or @code{dprintf-gnu}:
@itemize
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, Solaris 11.4, Cygwin 2.9.0.
+@item
printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an
incorrect result on some platforms:
Solaris 11.4.
diff --git a/doc/posix-functions/fprintf.texi b/doc/posix-functions/fprintf.texi
index 3ee74b41ae..7e1d2254ca 100644
--- a/doc/posix-functions/fprintf.texi
+++ b/doc/posix-functions/fprintf.texi
@@ -13,6 +13,12 @@ This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
@code{j}, @code{t}, @code{z}) on some platforms:
AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, IRIX 6.5, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
printf of @samp{long double} numbers is unsupported on some platforms:
mingw, MSVC 14.
@item
diff --git a/doc/posix-functions/fwprintf.texi b/doc/posix-functions/fwprintf.texi
index b9ce2eb024..2b4600de11 100644
--- a/doc/posix-functions/fwprintf.texi
+++ b/doc/posix-functions/fwprintf.texi
@@ -19,6 +19,12 @@ NetBSD 3.0, OpenBSD 3.8, Minix 3.1.8, HP-UX 11.00, IRIX 6.5, Cygwin 1.5.x.
On Windows and 32-bit AIX platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
This function does not support the @samp{b} directive, required by ISO C23,
on some platforms:
glibc 2.34, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
diff --git a/doc/posix-functions/printf.texi b/doc/posix-functions/printf.texi
index 382873e9e0..e8fafa4bdb 100644
--- a/doc/posix-functions/printf.texi
+++ b/doc/posix-functions/printf.texi
@@ -13,6 +13,12 @@ This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
@code{j}, @code{t}, @code{z}) on some platforms:
AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, IRIX 6.5, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
printf of @samp{long double} numbers is unsupported on some platforms:
mingw, MSVC 14.
@item
diff --git a/doc/posix-functions/snprintf.texi b/doc/posix-functions/snprintf.texi
index a5a7550c7d..032c6ff023 100644
--- a/doc/posix-functions/snprintf.texi
+++ b/doc/posix-functions/snprintf.texi
@@ -28,6 +28,12 @@ This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
@code{j}, @code{t}, @code{z}) on some platforms:
AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, IRIX 6.5, Solaris 11.4, Cygwin 2.9.0, mingw.
+@item
printf of @samp{long double} numbers is unsupported on some platforms:
mingw, MSVC 14.
@item
diff --git a/doc/posix-functions/sprintf.texi b/doc/posix-functions/sprintf.texi
index 54816f26ab..5d88d38c3f 100644
--- a/doc/posix-functions/sprintf.texi
+++ b/doc/posix-functions/sprintf.texi
@@ -13,6 +13,12 @@ This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
@code{j}, @code{t}, @code{z}) on some platforms:
AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, IRIX 6.5, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
printf of @samp{long double} numbers is unsupported on some platforms:
mingw, MSVC 14.
@item
diff --git a/doc/posix-functions/swprintf.texi b/doc/posix-functions/swprintf.texi
index 357cfc1ad4..b53c96c6d7 100644
--- a/doc/posix-functions/swprintf.texi
+++ b/doc/posix-functions/swprintf.texi
@@ -36,6 +36,12 @@ accommodate all Unicode characters.
@item
On Windows, this function does not take a buffer size as second argument.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
This function ignores the minimum field width in the @samp{lc} directive
on some platforms:
@c https://www.openwall.com/lists/musl/2023/03/20/1
diff --git a/doc/posix-functions/vdprintf.texi b/doc/posix-functions/vdprintf.texi
index 59138d5d15..f21172c441 100644
--- a/doc/posix-functions/vdprintf.texi
+++ b/doc/posix-functions/vdprintf.texi
@@ -16,6 +16,12 @@ Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX
Portability problems fixed by either Gnulib module @code{vdprintf-posix} or @code{vdprintf-gnu}:
@itemize
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, Solaris 11.4, Cygwin 2.9.0.
+@item
printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an
incorrect result on some platforms:
Solaris 11.4.
diff --git a/doc/posix-functions/vfprintf.texi b/doc/posix-functions/vfprintf.texi
index 719bba0698..b4ae2cc733 100644
--- a/doc/posix-functions/vfprintf.texi
+++ b/doc/posix-functions/vfprintf.texi
@@ -13,6 +13,12 @@ This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
@code{j}, @code{t}, @code{z}) on some platforms:
AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, IRIX 6.5, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
printf of @samp{long double} numbers is unsupported on some platforms:
mingw, MSVC 14.
@item
diff --git a/doc/posix-functions/vfwprintf.texi b/doc/posix-functions/vfwprintf.texi
index f6e136b0b1..22e4a59212 100644
--- a/doc/posix-functions/vfwprintf.texi
+++ b/doc/posix-functions/vfwprintf.texi
@@ -19,6 +19,12 @@ NetBSD 3.0, OpenBSD 3.8, Minix 3.1.8, HP-UX 11.00, IRIX 6.5, Cygwin 1.5.x.
On Windows and 32-bit AIX platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
This function does not support the @samp{b} directive, required by ISO C23,
on some platforms:
glibc 2.34, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
diff --git a/doc/posix-functions/vprintf.texi b/doc/posix-functions/vprintf.texi
index 051aef880d..a69eb467cd 100644
--- a/doc/posix-functions/vprintf.texi
+++ b/doc/posix-functions/vprintf.texi
@@ -13,6 +13,12 @@ This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
@code{j}, @code{t}, @code{z}) on some platforms:
AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, IRIX 6.5, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
printf of @samp{long double} numbers is unsupported on some platforms:
mingw, MSVC 14.
@item
diff --git a/doc/posix-functions/vsnprintf.texi b/doc/posix-functions/vsnprintf.texi
index e99292f178..90613a95ef 100644
--- a/doc/posix-functions/vsnprintf.texi
+++ b/doc/posix-functions/vsnprintf.texi
@@ -25,6 +25,12 @@ This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
@code{j}, @code{t}, @code{z}) on some platforms:
AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, IRIX 6.5, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
printf of @samp{long double} numbers is unsupported on some platforms:
mingw, MSVC 14.
@item
diff --git a/doc/posix-functions/vsprintf.texi b/doc/posix-functions/vsprintf.texi
index 5ae3644e00..e75af4fb3b 100644
--- a/doc/posix-functions/vsprintf.texi
+++ b/doc/posix-functions/vsprintf.texi
@@ -13,6 +13,12 @@ This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
@code{j}, @code{t}, @code{z}) on some platforms:
AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, Cygwin 1.5.24, mingw, MSVC 14.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, IRIX 6.5, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
printf of @samp{long double} numbers is unsupported on some platforms:
mingw, MSVC 14.
@item
diff --git a/doc/posix-functions/vswprintf.texi b/doc/posix-functions/vswprintf.texi
index 62a644fb6d..4083cfd2a1 100644
--- a/doc/posix-functions/vswprintf.texi
+++ b/doc/posix-functions/vswprintf.texi
@@ -21,6 +21,12 @@ accommodate all Unicode characters.
@item
On Windows, this function does not take a buffer size as second argument.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
This function does not support the @samp{b} directive, required by ISO C23,
on some platforms:
glibc 2.34, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
diff --git a/doc/posix-functions/vwprintf.texi b/doc/posix-functions/vwprintf.texi
index 80c8646663..7b029c9ceb 100644
--- a/doc/posix-functions/vwprintf.texi
+++ b/doc/posix-functions/vwprintf.texi
@@ -22,6 +22,12 @@ platforms: Cygwin 1.5.x.
On Windows and 32-bit AIX platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
This function does not support the @samp{b} directive, required by ISO C23,
on some platforms:
glibc 2.34, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
diff --git a/doc/posix-functions/wprintf.texi b/doc/posix-functions/wprintf.texi
index 1c3b99b281..56106b309e 100644
--- a/doc/posix-functions/wprintf.texi
+++ b/doc/posix-functions/wprintf.texi
@@ -22,6 +22,12 @@ platforms: Cygwin 1.5.x.
On Windows and 32-bit AIX platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@item
+This function does not support size specifiers as in C23 (@code{w8},
+@code{w16}, @code{w32}, @code{w64}, @code{wf8}, @code{wf16}, @code{wf32},
+@code{wf64}) on some platforms:
+glibc, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+AIX 7.2, HP-UX 11, Solaris 11.4, Cygwin 2.9.0, mingw, MSVC 14.
+@item
This function does not support the @samp{b} directive, required by ISO C23,
on some platforms:
glibc 2.34, musl libc, macOS 12.5, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,