From 4b440d3568b01dd9acd5242bea8b63fc43428f5a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 19 Apr 2023 02:14:09 +0200 Subject: wcscmp: Work around two ISO C compliance bugs on several platforms. * lib/wchar.in.h (wcscmp): Consider REPLACE_WCSCMP. * lib/wcscmp-impl.h (wcscmp): Don't assume that the two wide characters are in the range 0..INT_MAX. * m4/wcscmp.m4 (gl_FUNC_WCSCMP): Test whether wcscmp works for all wide characters. Set REPLACE_WCSCMP. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSCMP. * modules/wchar (Makefile.am): Substitute REPLACE_WCSCMP. * modules/wcscmp (Status, Notice): Un-obsolete this module. (configure.ac): Consider REPLACE_WCSCMP. * doc/posix-functions/wcscmp.texi: Mention the two bugs. --- doc/posix-functions/wcscmp.texi | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc') diff --git a/doc/posix-functions/wcscmp.texi b/doc/posix-functions/wcscmp.texi index 4c4de8c6dc..bc64d28f56 100644 --- a/doc/posix-functions/wcscmp.texi +++ b/doc/posix-functions/wcscmp.texi @@ -8,6 +8,14 @@ Gnulib module: wcscmp Portability problems fixed by Gnulib: @itemize +@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, macOS 12.5, FreeBSD 13.2, NetBSD 9.0, OpenBSD 7.2, Solaris 11.4. +@item +This function may return a wrong result if the two arguments are of different +length, on some platforms: +AIX 7.2 in 64-bit mode. @end itemize Portability problems not fixed by Gnulib: -- cgit v1.2.1