From 6c28538c9d6bbf692ab12972de6cc035e54b0c67 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 19 Apr 2023 01:01:56 +0200 Subject: wmemcmp: Work around ISO C compliance bug on several platforms. * lib/wchar.in.h (wmemcmp): Consider REPLACE_WMEMCMP. * lib/wmemcmp-impl.h (wmemcmp): Don't assume that the two wide characters are in the range 0..INT_MAX. * m4/wmemcmp.m4 (gl_FUNC_WMEMCMP): Test whether wmemcmp works for all wide characters. Set REPLACE_WMEMCMP. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WMEMCMP. * modules/wchar (Makefile.am): Substitute REPLACE_WMEMCMP. * modules/wmemcmp (configure.ac): Consider REPLACE_WMEMCMP. * doc/posix-functions/wmemcmp.texi: Mention the bug. --- doc/posix-functions/wmemcmp.texi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/posix-functions/wmemcmp.texi b/doc/posix-functions/wmemcmp.texi index 8d3262c5cb..cebacfb664 100644 --- a/doc/posix-functions/wmemcmp.texi +++ b/doc/posix-functions/wmemcmp.texi @@ -11,6 +11,10 @@ Portability problems fixed by Gnulib: @item This function is missing on some platforms: HP-UX 11.00, IRIX 6.5, MSVC 14. +@item +This function compares the wide characters as if they were unsigned, although +@code{wchar_t} is signed, on some platforms: +glibc 2.14.1 on x86 or x86_64, musl libc 1.2.3, NetBSD 9.0, OpenBSD 7.2, Solaris 11.4. @end itemize Portability problems not fixed by Gnulib: -- cgit v1.2.1