From 09a9ccc95ddd3e4ffbf386cca440b944c91d3412 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 3 Apr 2023 14:24:37 +0200 Subject: mbrtoc32 tests: Add comment. * m4/mbrtowc.m4 (gl_MBRTOWC_C_LOCALE): Add comment. * m4/mbrtoc32.m4 (gl_MBRTOC32_C_LOCALE): Add comment. * tests/test-mbrtoc32.c: Add comment. * tests/test-mbrtoc32-5.sh: Use symmetric coding style. * doc/posix-functions/mbrtoc32.texi: Update. --- m4/mbrtoc32.m4 | 7 ++++++- m4/mbrtowc.m4 | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'm4') diff --git a/m4/mbrtoc32.m4 b/m4/mbrtoc32.m4 index f2de33aff6..d6401fe2e4 100644 --- a/m4/mbrtoc32.m4 +++ b/m4/mbrtoc32.m4 @@ -1,4 +1,4 @@ -# mbrtoc32.m4 serial 10 +# mbrtoc32.m4 serial 11 dnl Copyright (C) 2014-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -101,6 +101,11 @@ changequote([,])dnl ]) ]) +dnl +dnl POSIX:2018 says regarding mbrtowc: "In the POSIX locale an [EILSEQ] error +dnl cannot occur since all byte values are valid characters." It is reasonable +dnl to expect mbrtoc32 to behave in the same way. + AC_DEFUN([gl_MBRTOC32_C_LOCALE], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4 index 4bf91bec3b..0c7a8bae69 100644 --- a/m4/mbrtowc.m4 +++ b/m4/mbrtowc.m4 @@ -712,6 +712,10 @@ dnl Test whether mbrtowc reports encoding errors in the C locale. dnl Although POSIX was never intended to allow this, the GNU C Library dnl and other implementations do it. See: dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932 +dnl POSIX has now clarified it: +dnl +dnl says: "In the POSIX locale an [EILSEQ] error cannot occur since all byte +dnl values are valid characters." AC_DEFUN([gl_MBRTOWC_C_LOCALE], [ -- cgit v1.2.1