From bbf0d3fdf25e8f85c7751ac0ee90a0f50a0f054d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 1 Apr 2023 14:51:22 +0200 Subject: vasnwprintf-posix: Fix behaviour in the C locale. * lib/vasnprintf.c (VASNPRINTF): If NEED_WPRINTF_DIRECTIVE_C is set, implement the 'c' directive here. * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke gl_MBRTOWC_C_LOCALE. If mbrtowc is buggy in the C locale, define NEED_WPRINTF_DIRECTIVE_C. * modules/vasnwprintf (Files): Add m4/mbrtowc.m4. * tests/test-vasnwprintf-posix.c (test_function): Add tests of %s and %c in the C locale. * doc/posix-functions/fwprintf.texi: Mention the C locale behaviour bug. * doc/posix-functions/swprintf.texi: Likewise. * doc/posix-functions/vfwprintf.texi: Likewise. * doc/posix-functions/vswprintf.texi: Likewise. * doc/posix-functions/vwprintf.texi: Likewise. * doc/posix-functions/wprintf.texi: Likewise. --- doc/posix-functions/fwprintf.texi | 4 ++++ doc/posix-functions/swprintf.texi | 4 ++++ doc/posix-functions/vfwprintf.texi | 4 ++++ doc/posix-functions/vswprintf.texi | 4 ++++ doc/posix-functions/vwprintf.texi | 4 ++++ doc/posix-functions/wprintf.texi | 4 ++++ 6 files changed, 24 insertions(+) (limited to 'doc') diff --git a/doc/posix-functions/fwprintf.texi b/doc/posix-functions/fwprintf.texi index 2b4600de11..db42363cfa 100644 --- a/doc/posix-functions/fwprintf.texi +++ b/doc/posix-functions/fwprintf.texi @@ -34,6 +34,10 @@ The @code{%m} directive is not portable, use @code{%s} mapped to an argument of @code{strerror(errno)} (or a version of @code{strerror_r}) instead. @item +In the C or POSIX locales, the @code{%c} and @code{%s} conversions may fail +on some platforms: +glibc 2.35. +@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/swprintf.texi b/doc/posix-functions/swprintf.texi index b53c96c6d7..cd20d0e702 100644 --- a/doc/posix-functions/swprintf.texi +++ b/doc/posix-functions/swprintf.texi @@ -63,6 +63,10 @@ The @code{%m} directive is not portable, use @code{%s} mapped to an argument of @code{strerror(errno)} (or a version of @code{strerror_r}) instead. @item +In the C or POSIX locales, the @code{%c} and @code{%s} conversions may fail +on some platforms: +glibc 2.35. +@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/vfwprintf.texi b/doc/posix-functions/vfwprintf.texi index 22e4a59212..0712269aa4 100644 --- a/doc/posix-functions/vfwprintf.texi +++ b/doc/posix-functions/vfwprintf.texi @@ -34,6 +34,10 @@ The @code{%m} directive is not portable, use @code{%s} mapped to an argument of @code{strerror(errno)} (or a version of @code{strerror_r}) instead. @item +In the C or POSIX locales, the @code{%c} and @code{%s} conversions may fail +on some platforms: +glibc 2.35. +@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/vswprintf.texi b/doc/posix-functions/vswprintf.texi index 4083cfd2a1..7512a2d023 100644 --- a/doc/posix-functions/vswprintf.texi +++ b/doc/posix-functions/vswprintf.texi @@ -36,6 +36,10 @@ The @code{%m} directive is not portable, use @code{%s} mapped to an argument of @code{strerror(errno)} (or a version of @code{strerror_r}) instead. @item +In the C or POSIX locales, the @code{%c} and @code{%s} conversions may fail +on some platforms: +glibc 2.35. +@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/vwprintf.texi b/doc/posix-functions/vwprintf.texi index 7b029c9ceb..1e364288f6 100644 --- a/doc/posix-functions/vwprintf.texi +++ b/doc/posix-functions/vwprintf.texi @@ -37,6 +37,10 @@ The @code{%m} directive is not portable, use @code{%s} mapped to an argument of @code{strerror(errno)} (or a version of @code{strerror_r}) instead. @item +In the C or POSIX locales, the @code{%c} and @code{%s} conversions may fail +on some platforms: +glibc 2.35. +@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/wprintf.texi b/doc/posix-functions/wprintf.texi index 56106b309e..c4d58fab2e 100644 --- a/doc/posix-functions/wprintf.texi +++ b/doc/posix-functions/wprintf.texi @@ -37,6 +37,10 @@ The @code{%m} directive is not portable, use @code{%s} mapped to an argument of @code{strerror(errno)} (or a version of @code{strerror_r}) instead. @item +In the C or POSIX locales, the @code{%c} and @code{%s} conversions may fail +on some platforms: +glibc 2.35. +@item When formatting an integer with grouping flag, this function inserts thousands separators even in the "C" locale on some platforms: NetBSD 5.1. -- cgit v1.2.1