diff options
author | Bruno Haible <bruno@clisp.org> | 2023-03-21 15:49:06 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-03-21 15:58:04 +0100 |
commit | 4928ebfa61978ee1d9b79d1173cb11bcaa6f1038 (patch) | |
tree | 960de39e0a9b030c3b86f4a2ba477640df924fec /doc | |
parent | 2ccec72dcddf09e855fc300f748b0cdf91269ae4 (diff) | |
download | gnulib-4928ebfa61978ee1d9b79d1173cb11bcaa6f1038.tar.gz |
*printf-posix: Work around bug with %lc of 0 on many platforms.
* lib/vasnprintf.c (local_wctomb): Define also for
NEED_PRINTF_DIRECTIVE_LC.
(VASNPRINTF): Implement %lc handling ourselves if
NEED_PRINTF_DIRECTIVE_LC.
* m4/printf.m4 (gl_PRINTF_DIRECTIVE_LC): New macro.
* m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_DIRECTIVE_LC): New macro.
(gl_PREREQ_VASNPRINTF_WITH_EXTRAS): Invoke it.
* m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_POSIX): Require
gl_PRINTF_DIRECTIVE_LC and test its result. Invoke
gl_PREREQ_VASNPRINTF_DIRECTIVE_LC.
* m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_POSIX): Likewise.
* m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_POSIX): Likewise.
* m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_POSIX): Likewise.
* m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_POSIX): Likewise.
* m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_POSIX): Likewise.
* m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_POSIX): Likewise.
* m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_POSIX): Likewise.
* m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_POSIX): Likewise.
* m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_POSIX): Likewise.
* m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_POSIX): Likewise.
* tests/test-snprintf-posix.h (test_function): Add more tests for the
%c and %lc directives.
* tests/test-sprintf-posix.h (test_function): Likewise.
* tests/test-vasnprintf-posix.c (test_function): Likewise.
* tests/test-vasprintf-posix.c (test_function): Likewise.
* doc/glibc-functions/asprintf.texi: Mention the %lc 0 bug.
* doc/glibc-functions/obstack_printf.texi: Likewise.
* doc/glibc-functions/obstack_vprintf.texi: Likewise.
* doc/glibc-functions/vasprintf.texi: Likewise.
* doc/posix-functions/dprintf.texi: Likewise.
* doc/posix-functions/fprintf.texi: Likewise.
* doc/posix-functions/printf.texi: Likewise.
* doc/posix-functions/snprintf.texi: Likewise.
* doc/posix-functions/sprintf.texi: Likewise.
* doc/posix-functions/vdprintf.texi: Likewise.
* doc/posix-functions/vfprintf.texi: Likewise.
* doc/posix-functions/vprintf.texi: Likewise.
* doc/posix-functions/vsnprintf.texi: Likewise.
* doc/posix-functions/vsprintf.texi: Likewise.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/glibc-functions/asprintf.texi | 4 | ||||
-rw-r--r-- | doc/glibc-functions/obstack_printf.texi | 4 | ||||
-rw-r--r-- | doc/glibc-functions/obstack_vprintf.texi | 4 | ||||
-rw-r--r-- | doc/glibc-functions/vasprintf.texi | 4 | ||||
-rw-r--r-- | doc/posix-functions/dprintf.texi | 4 | ||||
-rw-r--r-- | doc/posix-functions/fprintf.texi | 4 | ||||
-rw-r--r-- | doc/posix-functions/printf.texi | 4 | ||||
-rw-r--r-- | doc/posix-functions/snprintf.texi | 4 | ||||
-rw-r--r-- | doc/posix-functions/sprintf.texi | 4 | ||||
-rw-r--r-- | doc/posix-functions/vdprintf.texi | 4 | ||||
-rw-r--r-- | doc/posix-functions/vfprintf.texi | 4 | ||||
-rw-r--r-- | doc/posix-functions/vprintf.texi | 4 | ||||
-rw-r--r-- | doc/posix-functions/vsnprintf.texi | 4 | ||||
-rw-r--r-- | doc/posix-functions/vsprintf.texi | 4 |
14 files changed, 56 insertions, 0 deletions
diff --git a/doc/glibc-functions/asprintf.texi b/doc/glibc-functions/asprintf.texi index 47708c40fb..70de08dd1c 100644 --- a/doc/glibc-functions/asprintf.texi +++ b/doc/glibc-functions/asprintf.texi @@ -71,6 +71,10 @@ printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded with zeroes) on some platforms: Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, Solaris 11.0, Cygwin 1.5.x. @item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. +@item This function can crash in out-of-memory conditions on some platforms: FreeBSD 13.0, NetBSD 5.0. @end itemize diff --git a/doc/glibc-functions/obstack_printf.texi b/doc/glibc-functions/obstack_printf.texi index 7feae78b36..8b13e1296e 100644 --- a/doc/glibc-functions/obstack_printf.texi +++ b/doc/glibc-functions/obstack_printf.texi @@ -77,6 +77,10 @@ This function does not support precisions larger than 512 or 1024 in integer, floating-point and pointer output on some platforms: Solaris 10/x86, mingw, MSVC/clang. @item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. +@item This function can crash in out-of-memory conditions on some platforms: FreeBSD 13.0, NetBSD 5.0. @item diff --git a/doc/glibc-functions/obstack_vprintf.texi b/doc/glibc-functions/obstack_vprintf.texi index cdded10221..2ea59ef4fa 100644 --- a/doc/glibc-functions/obstack_vprintf.texi +++ b/doc/glibc-functions/obstack_vprintf.texi @@ -77,6 +77,10 @@ This function does not support precisions larger than 512 or 1024 in integer, floating-point and pointer output on some platforms: Solaris 10/x86, mingw, MSVC/clang. @item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. +@item This function can crash in out-of-memory conditions on some platforms: FreeBSD 13.0, NetBSD 5.0. @item diff --git a/doc/glibc-functions/vasprintf.texi b/doc/glibc-functions/vasprintf.texi index 2f69df8e78..ef1be6bb88 100644 --- a/doc/glibc-functions/vasprintf.texi +++ b/doc/glibc-functions/vasprintf.texi @@ -71,6 +71,10 @@ printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded with zeroes) on some platforms: Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, Solaris 11.0, Cygwin 1.5.x. @item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. +@item This function can crash in out-of-memory conditions on some platforms: FreeBSD 13.0, NetBSD 5.0. @end itemize diff --git a/doc/posix-functions/dprintf.texi b/doc/posix-functions/dprintf.texi index 7d5aeb9051..09e308c33b 100644 --- a/doc/posix-functions/dprintf.texi +++ b/doc/posix-functions/dprintf.texi @@ -44,6 +44,10 @@ Solaris 11.4. This function does not support precisions larger than 512 or 1024 in integer, floating-point and pointer output on some platforms: AIX 7.1. +@item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/fprintf.texi b/doc/posix-functions/fprintf.texi index eedd9babbf..513777c0a4 100644 --- a/doc/posix-functions/fprintf.texi +++ b/doc/posix-functions/fprintf.texi @@ -69,6 +69,10 @@ This function mishandles large floating point precisions on some platforms: Solaris 10. @item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. +@item This function can crash in out-of-memory conditions on some platforms: FreeBSD 13.0, NetBSD 5.0. @end itemize diff --git a/doc/posix-functions/printf.texi b/doc/posix-functions/printf.texi index c32881c2cc..8a3971aa30 100644 --- a/doc/posix-functions/printf.texi +++ b/doc/posix-functions/printf.texi @@ -69,6 +69,10 @@ This function mishandles large floating point precisions on some platforms: Solaris 10. @item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. +@item This function can crash in out-of-memory conditions on some platforms: FreeBSD 13.0, NetBSD 5.0. @end itemize diff --git a/doc/posix-functions/snprintf.texi b/doc/posix-functions/snprintf.texi index 6d8453b9fe..9ea76cfa8b 100644 --- a/doc/posix-functions/snprintf.texi +++ b/doc/posix-functions/snprintf.texi @@ -80,6 +80,10 @@ This function mishandles large floating point precisions on some platforms: Solaris 10. @item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. +@item This function can crash in out-of-memory conditions on some platforms: FreeBSD 13.0, NetBSD 5.0. @item diff --git a/doc/posix-functions/sprintf.texi b/doc/posix-functions/sprintf.texi index 8974498ebf..57c42c294d 100644 --- a/doc/posix-functions/sprintf.texi +++ b/doc/posix-functions/sprintf.texi @@ -69,6 +69,10 @@ This function mishandles large floating point precisions on some platforms: Solaris 10. @item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. +@item This function can crash in out-of-memory conditions on some platforms: FreeBSD 13.0, NetBSD 5.0. @item diff --git a/doc/posix-functions/vdprintf.texi b/doc/posix-functions/vdprintf.texi index d4de64ee25..d533d32892 100644 --- a/doc/posix-functions/vdprintf.texi +++ b/doc/posix-functions/vdprintf.texi @@ -44,6 +44,10 @@ Solaris 11.4. This function does not support precisions larger than 512 or 1024 in integer, floating-point and pointer output on some platforms: AIX 7.1. +@item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/vfprintf.texi b/doc/posix-functions/vfprintf.texi index f3ec56b5a6..252ac10e2b 100644 --- a/doc/posix-functions/vfprintf.texi +++ b/doc/posix-functions/vfprintf.texi @@ -69,6 +69,10 @@ This function mishandles large floating point precisions on some platforms: Solaris 10. @item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. +@item This function can crash in out-of-memory conditions on some platforms: FreeBSD 13.0, NetBSD 5.0. @end itemize diff --git a/doc/posix-functions/vprintf.texi b/doc/posix-functions/vprintf.texi index 6e05d41002..8272e50fd9 100644 --- a/doc/posix-functions/vprintf.texi +++ b/doc/posix-functions/vprintf.texi @@ -69,6 +69,10 @@ This function mishandles large floating point precisions on some platforms: Solaris 10. @item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. +@item This function can crash in out-of-memory conditions on some platforms: FreeBSD 13.0, NetBSD 5.0. @end itemize diff --git a/doc/posix-functions/vsnprintf.texi b/doc/posix-functions/vsnprintf.texi index 660ccfb1c3..3531644660 100644 --- a/doc/posix-functions/vsnprintf.texi +++ b/doc/posix-functions/vsnprintf.texi @@ -73,6 +73,10 @@ This function mishandles large floating point precisions on some platforms: Solaris 10. @item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. +@item This function can crash in out-of-memory conditions on some platforms: FreeBSD 13.0, NetBSD 5.0. @item diff --git a/doc/posix-functions/vsprintf.texi b/doc/posix-functions/vsprintf.texi index 8af4bdf279..27ec5b9141 100644 --- a/doc/posix-functions/vsprintf.texi +++ b/doc/posix-functions/vsprintf.texi @@ -69,6 +69,10 @@ This function mishandles large floating point precisions on some platforms: Solaris 10. @item +This function produces wrong output for the @samp{lc} directive with a NUL +wide character argument on some platforms: +glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2, Solaris 11.4, and others. +@item This function can crash in out-of-memory conditions on some platforms: FreeBSD 13.0, NetBSD 5.0. @item |