Bruno Haible [Mon, 4 Sep 2023 19:54:09 +0000 (21:54 +0200)]
Use statement-expressions without warnings, even in strict ISO C mode.
Suggested by Eric Blake <eblake@redhat.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-09/msg00025.html>.
* lib/error.in.h (__gl_error_call): Use the variant with obvious control
flow also with clang. Use '__extension__' to avoid -Wpedantic warnings.
* lib/math.in.h (gl_signbitf, gl_signbitd, gl_signbitl): Define as
macros even when __STRICT_ANSI__ is defined. But use '__extension__' to
avoid -Wpedantic warnings.
* lib/setenv.c (KNOWN_VALUE): Use '__extension__' to avoid -Wpedantic
warnings.
* lib/xalloc-oversized.h (xalloc_oversized): Use optimized variant even
when __STRICT_ANSI__ is defined. But use '__extension__' to avoid
-Wpedantic warnings.
Paul Eggert [Wed, 30 Aug 2023 17:15:09 +0000 (10:15 -0700)]
wchar-single: fix module broken since 2021
Adjust to 2021-03-07 change “Rename GNULIB_WCHAR_SINGLE to
GNULIB_WCHAR_SINGLE_LOCALE”. Apparently nobody noticed that
the module was broken. Perhaps we should obsolete the module?
* modules/wchar-single (GNULIB_WCHAR_SINGLE_LOCALE): Define.
Bruno Haible [Sat, 26 Aug 2023 20:45:17 +0000 (22:45 +0200)]
crypto/{sha*,md5,sm3}-buffer: Ignore too old OpenSSL versions.
* lib/sha1.h: If <openssl/macros.h> would give a compile-time error,
undefine HAVE_OPENSSL_SHA1.
* lib/sha256.h: If <openssl/macros.h> would give a compile-time error,
undefine HAVE_OPENSSL_SHA256.
* lib/sha512.h: If <openssl/macros.h> would give a compile-time error,
undefine HAVE_OPENSSL_SHA512.
* lib/md5.h: If <openssl/macros.h> would give a compile-time error,
undefine HAVE_OPENSSL_MD5.
* lib/sm3.h: If <openssl/macros.h> would give a compile-time error,
undefine HAVE_OPENSSL_SM3.
Bruno Haible [Mon, 21 Aug 2023 15:23:41 +0000 (17:23 +0200)]
alignasof, stdalign: Fix a compilation error in C++ mode on FreeBSD 12.
* m4/stdalign.m4 (gl_ALIGNASOF): In C++ mode, prefer __builtin_offsetof
over offsetof when possible, since __builtin_offsetof works also when
<stddef.h> has not been fully included yet.
Bruno Haible [Mon, 21 Aug 2023 13:58:16 +0000 (15:58 +0200)]
wcsstr-simple: Relicense under LGPLv2+.
* modules/wcsstr-simple (License): Change to LGPLv2+.
* lib/wcsstr.c: Update license notice.
* lib/wcsstr-impl.h: Update license notice. The code added here on
2023-03-27 was under LGPLv2+.
Bruno Haible [Sun, 20 Aug 2023 00:43:01 +0000 (02:43 +0200)]
ldexp: Work around OpenBSD/mips64 bug.
* lib/math.in.h (ldexp): New declaration.
* lib/ldexp.c: New file, based on lib/ldexpl.c.
* lib/ldexpl.c: Moved the implementation to lib/ldexp.c. Just include
it.
* m4/math_h.m4 (gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_LDEXP.
(gl_MATH_H_DEFAULTS): Initialize REPLACE_LDEXP.
* m4/ldexp.m4 (gl_FUNC_LDEXP): Require gl_MATH_H_DEFAULTS and
gl_FUNC_ISNAND. Invoke gl_FUNC_LDEXP_WORKS. Set REPLACE_LDEXP. Consider
it when setting LDEXP_LIBM.
(gl_FUNC_LDEXP_WORKS): New macro.
* modules/math (Makefile.am): Substitute GNULIB_LDEXP, REPLACE_LDEXP.
* modules/ldexp (Files): Add lib/ldexp.c.
(Depends-on): Add math, isnand.
(configure.ac): Set GL_COND_OBJ_LDEXP. Invoke gl_MATH_MODULE_INDICATOR.
(Makefile.am): Conditionally compile ldexp.c.
* modules/ldexpl (Files): Add lib/ldexp.c.
* doc/posix-functions/ldexp.texi: Mention the OpenBSD bug.
Bruno Haible [Sat, 19 Aug 2023 22:45:05 +0000 (00:45 +0200)]
logbl: Work around endless loop on OpenBSD 7.3/mips64.
* m4/logbl.m4 (gl_FUNC_LOGBL_WORKS): Terminate the test program if it
takes longer than 5 seconds.
* doc/posix-functions/logbl.texi: Mention the OpenBSD bug.
Bruno Haible [Fri, 18 Aug 2023 20:38:04 +0000 (22:38 +0200)]
thrd: Work around thrd_join bug on AIX 7.3.1.
* m4/threads_h.m4 (gl_THREADS_H): Test against AIX 7 thrd_join bug. Set
BROKEN_THRD_JOIN.
(gl_THREADS_H_DEFAULTS): Initialize BROKEN_THRD_JOIN.
* m4/thrd.m4 (gl_FUNC_THRD_JOIN): Set REPLACE_THRD_* to 1 also if
BROKEN_THRD_JOIN is 1. Define BROKEN_THRD_START_T_OR_JOIN instead of
BROKEN_THRD_START_T.
* modules/threads-h (Makefile.am): Substitute BROKEN_THRD_JOIN.
* lib/threads.in.h (rpl_thrd_t, thrd_t): Define also if BROKEN_THRD_JOIN
is 1.
* lib/thrd.c: Test BROKEN_THRD_START_T_OR_JOIN instead of
BROKEN_THRD_START_T.
* doc/posix-functions/thrd_join.texi: Update.
* doc/posix-functions/thrd_exit.texi: Likewise.
Bruno Haible [Fri, 18 Aug 2023 19:14:40 +0000 (21:14 +0200)]
thrd: Refactor.
* m4/thrd.m4 (gl_FUNC_THRD_JOIN): Define BROKEN_THRD_JOIN_NULL, not
BROKEN_THRD_JOIN. Rename gl_cv_func_thrd_join_works to
gl_cv_func_thrd_join_null_works.
* lib/thrd.c: Test BROKEN_THRD_JOIN_NULL instead of BROKEN_THRD_JOIN.
Bruno Haible [Fri, 18 Aug 2023 16:54:28 +0000 (18:54 +0200)]
aligned_alloc: Fix test failure on AIX 7.3 with ibm-clang.
* m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Use 'volatile', to
disable optimization of ibm-clang -O2.
* doc/posix-functions/aligned_alloc.texi: Update version info.
Bruno Haible [Thu, 3 Aug 2023 16:09:29 +0000 (18:09 +0200)]
alignasof, stdalign: Avoid some -Wundef warnings from config.h.
Reported by Tim Rühsen <tim.ruehsen@gmx.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-08/msg00012.html>.
* m4/stdalign.m4 (gl_ALIGNASOF): Test whether __cplusplus is defined
before evaluating it. Assume HAVE_STDALIGN_H, _GL_STDALIGN_NEEDS_STDDEF
are never defined to 0.
* lib/readutmp.h (extract_trimmed_name): Add specification comment.
(read_utmp): Move specification comment from lib/readutmp.c to here.
Mention also UTMP_FILE and READ_UTMP_USER_PROCESS.
* lib/readutmp.c (extract_trimmed_name): Fix comment.
* modules/readutmp (Include): Only include the .h file if
HAVE_UTMPX_H || HAVE_UTMP_H.
Paul Eggert [Sun, 30 Jul 2023 00:06:42 +0000 (17:06 -0700)]
readutmp: work around glibc utmpx bug
When compiled with _TIME_BITS=64, glibc <utmpx.h> does not work,
because the files use 32-bit time_t and the code passes this to
the user unmodified, but <utmpx.h> defines a struct with 64-bit
time_t. Work around this compatibility bug. Problem reported
by Jakub Wilk via Sven Joachim <https://bugs.gnu.org/64937>.
* lib/readutmp.c (copy_utmp_entry): New function.
(read_utmp): Use it.
Bruno Haible [Fri, 28 Jul 2023 13:15:26 +0000 (15:15 +0200)]
uchar: Include the necessary snippets.
* lib/uchar.in.h: Add insertion points for _GL_ARG_NONNULL and
_GL_WARN_ON_USE.
* modules/uchar (Depends-on): Add snippet/arg-nonnull,
snippet/warn-on-use.
(Makefile.am): In uchar.h, include the ARG_NONNULL_H and WARN_ON_USE_H
snippets.
Bruno Haible [Wed, 28 Jun 2023 16:36:02 +0000 (18:36 +0200)]
mbrtoc16: Add tests.
* tests/test-mbrtoc16.c: New file, based on tests/test-mbrtoc32.c.
* tests/test-mbrtoc16-1.sh: New file, based on tests/test-mbrtoc32-1.sh.
* tests/test-mbrtoc16-2.sh: New file, based on tests/test-mbrtoc32-2.sh.
* tests/test-mbrtoc16-3.sh: New file, based on tests/test-mbrtoc32-3.sh.
* tests/test-mbrtoc16-4.sh: New file, based on tests/test-mbrtoc32-4.sh.
* tests/test-mbrtoc16-5.sh: New file, based on tests/test-mbrtoc32-5.sh.
* tests/test-mbrtoc16-w32.c: New file, based on
tests/test-mbrtoc32-w32.c.
* tests/test-mbrtoc16-w32-1.sh: New file, based on
tests/test-mbrtoc32-w32-1.sh.
* tests/test-mbrtoc16-w32-2.sh: New file, based on
tests/test-mbrtoc32-w32-2.sh.
* tests/test-mbrtoc16-w32-3.sh: New file, based on
tests/test-mbrtoc32-w32-3.sh.
* tests/test-mbrtoc16-w32-4.sh: New file, based on
tests/test-mbrtoc32-w32-4.sh.
* tests/test-mbrtoc16-w32-5.sh: New file, based on
tests/test-mbrtoc32-w32-5.sh.
* tests/test-mbrtoc16-w32-6.sh: New file, based on
tests/test-mbrtoc32-w32-6.sh.
* tests/test-mbrtoc16-w32-7.sh: New file, based on
tests/test-mbrtoc32-w32-7.sh.
* modules/mbrtoc16-tests: New file, based on modules/mbrtoc32-tests.
Bruno Haible [Wed, 28 Jun 2023 16:28:23 +0000 (18:28 +0200)]
mbrtoc16: New module.
* lib/uchar.in.h (mbrtoc16): New declaration.
* lib/mbrtoc16.c: New file.
* m4/mbrtoc16.m4: New file, based on m4/mbrtoc32.m4.
* modules/mbrtoc16: New file.
* m4/uchar_h.m4 (gl_UCHAR_H): Test whether mbrtoc16 is declared.
(gl_UCHAR_H_REQUIRE_DEFAULTS): Initialize GNULIB_MBRTOC16.
(gl_UCHAR_H_DEFAULTS): Initialize HAVE_MBRTOC16, REPLACE_MBRTOC16.
* modules/uchar (Makefile.am): Substitute GNULIB_MBRTOC16,
HAVE_MBRTOC16, REPLACE_MBRTOC16.
* doc/posix-functions/mbrtoc16.texi: Mention the mbrtoc16 module and the
mbsinit related limitation.
* doc/posix-functions/mbsinit.texi: Mention the mbrtoc16 related
limitation.
Bruno Haible [Wed, 28 Jun 2023 10:35:21 +0000 (12:35 +0200)]
mbrtoc32: Doc tweak.
* doc/posix-functions/mbrtoc32.texi: Mention that mingw and Android have
the empty input bug.
* m4/mbrtoc32.m4 (gl_MBRTOC32_EMPTY_INPUT): Update cross-compilation
guess.
Bruno Haible [Wed, 28 Jun 2023 13:01:33 +0000 (15:01 +0200)]
mbrtowc: Doc tweak.
* doc/posix-functions/mbrtowc.texi: Mention that MSVC has the empty
input bug and the return value bug. Mention that Android has the empty
input bug.
* m4/mbrtowc.m4 (gl_MBRTOC32_EMPTY_INPUT): Update cross-compilation
guess.
Bruno Haible [Tue, 27 Jun 2023 09:28:26 +0000 (11:28 +0200)]
c32*: Optionally enforce ISO C 23 semantics of char32_t.
* lib/lc-charset-unicode.h: New file.
* lib/lc-charset-unicode.c: New file.
* modules/uchar-c23: New file.
* lib/uchar.in.h (char32_t): Add comment.
* lib/mbrtoc32.c: Include lc-charset-unicode.h.
(mbrtoc32): If char32_t is Unicode and wchar_t is not, invoke
locale_encoding_to_unicode.
* lib/btoc32.c: Include lc-charset-unicode.h.
(btoc32): If char32_t is Unicode and wchar_t is not, invoke
locale_encoding_to_unicode.
* lib/c32rtomb.c: Include lc-charset-unicode.h.
(c32rtomb): If char32_t is Unicode and wchar_t is not, invoke
unicode_to_locale_encoding.
* lib/c32tob.c: Include lc-charset-unicode.h.
(c32tob): If char32_t is Unicode and wchar_t is not, invoke
unicode_to_locale_encoding.
* lib/mbsnrtoc32s.c: If char32_t is Unicode and wchar_t is not, don't
use mbsnrtowcs.
* lib/mbsrtoc32s.c: If char32_t is Unicode and wchar_t is not, don't use
mbsrtowcs.
* lib/c32snrtombs.c: If char32_t is Unicode and wchar_t is not, don't
use wcsnrtombs.
* lib/c32srtombs.c: If char32_t is Unicode and wchar_t is not, don't use
wcsrtombs.
* lib/c32is-impl.h: Include lc-charset-unicode.h.
(FUNC): If char32_t is Unicode and wchar_t is not, use UCS_FUNC.
* lib/c32to-impl.h: Include lc-charset-unicode.h.
(FUNC): If char32_t is Unicode and wchar_t is not, use UCS_FUNC.
* lib/c32width.c: Include lc-charset-unicode.h.
(c32width): If char32_t is Unicode and wchar_t is not, use uc_width.
* tests/test-mbrtoc32.c: Include <wchar.h>.
(main): Skip GB18030 tests on NetBSD and Solaris. If
GL_CHAR32_T_IS_UNICODE, expect Unicode encoding for the char32_t values.
* tests/test-mbrtoc32-w32.c: Include <wchar.h>.
(test_one_locale): Simplify.
* tests/test-c32rtomb.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32rtomb.sh: Update.
* tests/test-mbsnrtoc32s.c: Include <wchar.h>.
(main): Skip GB18030 tests on NetBSD and Solaris.
* tests/test-mbsrtoc32s.c: Include <wchar.h>.
(main): Skip GB18030 tests on NetBSD and Solaris.
* tests/test-mbstoc32s.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32snrtombs.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32srtombs.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32stombs.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isalnum.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isalnum.sh: Update.
* tests/test-c32isalpha.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32isalpha.sh: Update.
* tests/test-c32isblank.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isblank.sh: Update.
* tests/test-c32iscntrl.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32iscntrl.sh: Update.
* tests/test-c32isdigit.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isdigit.sh: Update.
* tests/test-c32isgraph.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32isgraph.sh: Update.
* tests/test-c32islower.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32islower.sh: Update.
* tests/test-c32isprint.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32isprint.sh: Update.
* tests/test-c32ispunct.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32ispunct.sh: Update.
* tests/test-c32isspace.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isspace.sh: Update.
* tests/test-c32isupper.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isupper.sh: Update.
* tests/test-c32isxdigit.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isxdigit.sh: Update.
* tests/test-c32tolower.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32tolower.sh: Update.
* tests/test-c32toupper.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32toupper.sh: Update.
* modules/mbrtoc32 (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/mbrtoc32-tests (Makefile.am): Link test-mbrtoc32 with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/btoc32 (Link): New section.
* modules/btoc32-tests (Makefile.am): Link test-btoc32 with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/c32rtomb (Link): New section.
* modules/c32rtomb-tests (Makefile.am): Link test-c32rtomb with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/c32tob (Link): New section.
* modules/mbsnrtoc32s (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/mbsnrtoc32s-tests (Makefile.am): Link test-mbsnrtoc32s with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/mbsrtoc32s (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/mbsrtoc32s-tests (Makefile.am): Link test-mbsrtoc32s with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/mbstoc32s (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/mbstoc32s-tests (Makefile.am): Link test-mbstoc32s with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/c32snrtombs (Link): New section.
* modules/c32snrtombs-tests (Makefile.am): Link test-c32snrtombs with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/c32srtombs (Link): New section.
* modules/c32srtombs-tests (Makefile.am): Link test-c32srtombs with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/c32stombs (Link): New section.
* modules/c32stombs-tests (Makefile.am): Link test-c32stombs with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/c32isalnum (Link): Add $(LIBC32CONV).
* modules/c32isalnum-tests (Makefile.am): Link test-c32isalnum with
$(LIBC32CONV).
* modules/c32isalpha (Link): Add $(LIBC32CONV).
* modules/c32isalpha-tests (Makefile.am): Link test-c32isalpha with
$(LIBC32CONV).
* modules/c32isblank (Link): Add $(LIBC32CONV).
* modules/c32isblank-tests (Makefile.am): Link test-c32isblank with
$(LIBC32CONV).
* modules/c32iscntrl (Link): Add $(LIBC32CONV).
* modules/c32iscntrl-tests (Makefile.am): Link test-c32iscntrl with
$(LIBC32CONV).
* modules/c32isdigit (Link): Add $(LIBC32CONV).
* modules/c32isdigit-tests (Makefile.am): Link test-c32isdigit with
$(LIBC32CONV).
* modules/c32isgraph (Link): Add $(LIBC32CONV).
* modules/c32isgraph-tests (Makefile.am): Link test-c32isgraph with
$(LIBC32CONV).
* modules/c32islower (Link): Add $(LIBC32CONV).
* modules/c32islower-tests (Makefile.am): Link test-c32islower with
$(LIBC32CONV).
* modules/c32isprint (Link): Add $(LIBC32CONV).
* modules/c32isprint-tests (Makefile.am): Link test-c32isprint with
$(LIBC32CONV).
* modules/c32ispunct (Link): Add $(LIBC32CONV).
* modules/c32ispunct-tests (Makefile.am): Link test-c32ispunct with
$(LIBC32CONV).
* modules/c32isspace (Link): Add $(LIBC32CONV).
* modules/c32isspace-tests (Makefile.am): Link test-c32isspace with
$(LIBC32CONV).
* modules/c32isupper (Link): Add $(LIBC32CONV).
* modules/c32isupper-tests (Makefile.am): Link test-c32isupper with
$(LIBC32CONV).
* modules/c32isxdigit (Link): Add $(LIBC32CONV).
* modules/c32isxdigit-tests (Makefile.am): Link test-c32isxdigit with
$(LIBC32CONV).
* modules/c32tolower (Link): Add $(LIBC32CONV).
* modules/c32tolower-tests (Makefile.am): Link test-c32tolower with
$(LIBC32CONV).
* modules/c32toupper (Link): Add $(LIBC32CONV).
* modules/c32toupper-tests (Makefile.am): Link test-c32toupper with
$(LIBC32CONV).
* modules/c32width (Link): Add $(LIBC32CONV).
* modules/c32width-tests (Makefile.am): Link test-c32width with
$(LIBC32CONV).
* modules/c32swidth (Link): Add $(LIBC32CONV).
* modules/c32swidth-tests (Makefile.am): Link test-c32swidth with
$(LIBC32CONV).
* modules/mbchar (Link): Add $(LIBC32CONV).
* modules/mbiter (Link): Add $(LIBC32CONV).
* modules/mbuiter (Link): Add $(LIBC32CONV).
* modules/mbfile (Link): Add $(LIBC32CONV).
* modules/mbmemcasecmp (Link): Add $(LIBC32CONV).
* modules/mbmemcasecmp-tests (Makefile.am): Link test-mbmemcasecmp with
$(LIBC32CONV).
* modules/mbscasecmp (Link): Add $(LIBC32CONV).
* modules/mbscasecmp-tests (Makefile.am): Link test-mbscasecmp with
$(LIBC32CONV).
* modules/mbscasestr (Link): Add $(LIBC32CONV).
* modules/mbscasestr-tests (Makefile.am): Link test-mbscasestr1,
test-mbscasestr2, test-mbscasestr3, test-mbscasestr4 with $(LIBC32CONV).
* modules/mbschr (Link): Add $(LIBC32CONV).
* modules/mbschr-tests (Makefile.am): Link test-mbschr with
$(LIBC32CONV).
* modules/mbscspn (Link): Add $(LIBC32CONV).
* modules/mbscspn-tests (Makefile.am): Link test-mbscspn with
$(LIBC32CONV).
* modules/mbslen (Link): Add $(LIBC32CONV).
* modules/mbsncasecmp (Link): Add $(LIBC32CONV).
* modules/mbsncasecmp-tests (Makefile.am): Link test-mbsncasecmp with
$(LIBC32CONV).
* modules/mbsnlen (Link): Add $(LIBC32CONV).
* modules/mbspbrk (Link): Add $(LIBC32CONV).
* modules/mbspbrk-tests (Makefile.am): Link test-mbspbrk with
$(LIBC32CONV).
* modules/mbspcasecmp (Link): Add $(LIBC32CONV).
* modules/mbspcasecmp-tests (Makefile.am): Link test-mbspcasecmp with
$(LIBC32CONV).
* modules/mbsrchr (Link): Add $(LIBC32CONV).
* modules/mbsrchr-tests (Makefile.am): Link test-mbsrchr with
$(LIBC32CONV).
* modules/mbssep (Link): Add $(LIBC32CONV).
* modules/mbsspn (Link): Add $(LIBC32CONV).
* modules/mbsspn-tests (Makefile.am): Link test-mbsspn with
$(LIBC32CONV).
* modules/mbsstr (Link): Add $(LIBC32CONV).
* modules/mbsstr-tests (Makefile.am): Link test-mbsstr1, test-mbsstr2,
test-mbsstr3 with $(LIBC32CONV).
* modules/mbstok_r (Link): Add $(LIBC32CONV).
* modules/propername (Link): Add $(LIBC32CONV).
* modules/regex-quote (Link): Add $(LIBC32CONV).
* modules/regex-quote-tests (Makefile.am): Link test-regex-quote with
$(LIBC32CONV).
* modules/trim (Link): Add $(LIBC32CONV).
* modules/trim-tests (Makefile.am): Link test-trim with $(LIBC32CONV).
* modules/exclude (Link): Add $(LIBC32CONV).
* modules/exclude-tests (Makefile.am): Link test-exclude with
$(LIBC32CONV).
* doc/posix-headers/uchar.texi: Mention the uchar-c23 module.
* doc/posix-functions/mbrtoc32.texi: Likewise.
* doc/strings.texi (The char32_t type): Likewise.
Bruno Haible [Sun, 25 Jun 2023 18:18:41 +0000 (20:18 +0200)]
thread: Avoid compiler warnings on Solaris.
* lib/glthread/thread.h: Include <stdint.h>.
(gl_thread_self_pointer): Do the cast from pthread_t to 'void *' via
intptr_t.
* modules/thread (Depends-on): Add stdint.
Bruno Haible [Sun, 25 Jun 2023 17:11:26 +0000 (19:11 +0200)]
strerrorname_np: Add support for Solaris 11.4/sparc.
* lib/strerrorname_np.c (strerrorname_np): Consider ECKSUM, EFRAGS.
Allow ENOANO to be overloaded to another value.
* tests/test-strerrorname_np.c (main): Likewise.
Bruno Haible [Sun, 25 Jun 2023 16:19:06 +0000 (18:19 +0200)]
strerrorname_np: Work around glibc bug on PowerPC, SPARC systems.
* m4/strerrorname_np.m4 (gl_FUNC_STRERRORNAME_NP): Test also
strerrorname_np (EDEADLOCK).
* doc/glibc-functions/strerrorname_np.texi: Mention that glibc 2.36
still needs a workaround.
* lib/mbchar.h: Include <uchar.h> instead of <wchar.h>, <wctype.h>.
(struct mbchar): Use char32_t instead of wchar_t.
(mb_casecmp, mb_caseequal): Use c32tolower instead of towlower.
(mb_isalnum): Use c32isalnum instead of iswalnum.
(mb_isalpha): Use c32isalpha instead of iswalpha.
(mb_isblank): Use c32isblank instead of iswblank.
(mb_iscntrl): Use c32iscntrl instead of iswcntrl.
(mb_isdigit): Use c32isdigit instead of iswdigit.
(mb_isgraph): Use c32isgraph instead of iswgraph.
(mb_islower): Use c32islower instead of iswlower.
(mb_isprint): Use c32isprint instead of iswprint.
(mb_ispunct): Use c32ispunct instead of iswpunct.
(mb_isspace): Use c32isspace instead of iswspace.
(mb_isupper): Use c32isupper instead of iswupper.
(mb_isxdigit): Use c32isxdigit instead of iswxdigit.
(mb_width_aux): Use c32width, c32iscntrl instead of wcwidth, iswcntrl.
* lib/mbiter.h: Include <uchar.h> instead of <wchar.h>.
(mbiter_multi_next): Use mbrtoc32 instead of mbrtowc.
* lib/mbuiter.h: Include <uchar.h> instead of <wchar.h>.
(mbuiter_multi_next): Use mbrtoc32 instead of mbrtowc.
* lib/mbfile.h (mbfile_multi_getc): Use mbrtoc32 instead of mbrtowc.
* lib/mbscasestr.c (knuth_morris_pratt_multibyte, mbscasestr): Use
c32tolower instead of towlower.
* lib/exclude.c (string_hasher_ci): Use char32_t, c32tolower instead of
wchar_t, towlower.
* modules/mbchar (Depends-on): Add uchar, c32isalnum, c32isalpha,
c32isblank, c32iscntrl, c32isdigit, c32isgraph, c32islower, c32isprint,
c32ispunct, c32isspace, c32isupper, c32isxdigit, c32tolower, c32width.
Remove wchar, wctype-h, iswblank, iswdigit, iswxdigit, wcwidth.
* modules/mbiter (Depends-on): Add mbrtoc32, uchar. Remove mbrtowc,
wchar.
* modules/mbuiter (Depends-on): Likewise.
* modules/mbscasestr (Depends-on): Add c32tolower.
* modules/exclude (Depends-on): Add c32tolower.
* doc/strings.texi (C strings): Fix typo.