]> git.ipfire.org Git - thirdparty/gnulib.git/log
thirdparty/gnulib.git
18 hours agoautoupdate master
Karl Berry [Sun, 28 Jun 2026 14:43:16 +0000 (07:43 -0700)] 
autoupdate

42 hours agoautoupdate
Karl Berry [Sat, 27 Jun 2026 14:27:11 +0000 (07:27 -0700)] 
autoupdate

2 days agostrfmon_l: be consistent about unsigned vs size_t
Paul Eggert [Fri, 26 Jun 2026 18:34:12 +0000 (11:34 -0700)] 
strfmon_l: be consistent about unsigned vs size_t

* lib/strfmon_l.c (directives_t, fmon_parse):
Count is merely unsigned int, not size_t.

2 days agohashcode-mem: don’t infloop if UINT_MAX < size
Paul Eggert [Fri, 26 Jun 2026 18:28:58 +0000 (11:28 -0700)] 
hashcode-mem: don’t infloop if UINT_MAX < size

* lib/hashcode-mem.c (hash_pjw_bare): Use size_t for loop index.

2 days agogen-uni-tables: prefer size_t for size loops
Paul Eggert [Fri, 26 Jun 2026 18:27:32 +0000 (11:27 -0700)] 
gen-uni-tables: prefer size_t for size loops

* lib/gen-uni-tables.c (output_predicate, output_category)
(output_combclass, output_bidi_category, output_decimal_digit)
(output_digit, output_numeric, output_mirror)
(output_indic_conjunct_break, output_joining_type)
(output_joining_group, output_scripts, output_ident_category)
(output_lbpea, output_wbp, output_gbp_table)
(output_decomposition, output_simple_mapping):
Use size_t for loop indexes when the upper bound is size_t.

2 days agocrypto/gc-pbkdf2: redo unsigned indexes
Paul Eggert [Fri, 26 Jun 2026 18:23:40 +0000 (11:23 -0700)] 
crypto/gc-pbkdf2: redo unsigned indexes

* lib/gc-pbkdf2.c (gc_pbkdf2_prf):
Don’t infloop if upper bound of loop is UINT_MAX.

2 days agobitset: possibly widen unsigned indexes
Paul Eggert [Fri, 26 Jun 2026 18:20:50 +0000 (11:20 -0700)] 
bitset: possibly widen unsigned indexes

* lib/bitset/vector.c (vbitset_empty_p, vbitset_not)
(vbitset_disjoint_p, vbitset_and, vbitset_and_or)
(vbitset_and_or_cmp, vbitset_andn_or, vbitset_andn_or_cmp)
(vbitset_or_and, vbitset_or_and_cmp):
In a for-loop, use an index type related to the upper bound’s type
rather than trusting ‘unsigned’ to be wide enough.

2 days agobitrotate: prefer C2y to bitrotate or by-hand
Paul Eggert [Fri, 26 Jun 2026 17:29:05 +0000 (10:29 -0700)] 
bitrotate: prefer C2y to bitrotate or by-hand

Deprecate the bitrotate module; it is superseded by C2y’s
stdc_rotate_left and stdc_rotate_right.  In several places, prefer
the C2y functions to doing things by hand.
* lib/arctwo.c (arctwo_encrypt, arctwo_decyrpt):
* lib/hash.c (raw_hasher):
* lib/hashcode-mem.c (hash_pjw_bare):
* lib/hashcode-string1.c (hash_string):
* lib/hashcode-string2.c (hash_pjw):
* lib/hashkey-string.c (hashkey_string_hash):
* lib/mem-hash-map.c (compute_hashval):
* lib/struniq.h (hash):
* tests/test-array_map.c (string_hash):
* tests/test-avltreehash_list.c (string_hash):
* tests/test-hash_map.c (string_hash):
* tests/test-linkedhash_list.c (string_hash):
* tests/test-linkedhash_map.c (string_hash):
* tests/test-rbtreehash_list.c (string_hash):
Use stdbit.h functions, instead of bitrotate.h functions or doing
things by hand.  Include stdbit.h to get them.  Don’t include
bitrotate.h, if it was being included.
* lib/getlocalename_l-unsafe.c, lib/getlocalename_l.c:
* lib/localename.c:
Include stdbit.h, since struniq.h now needs this.
* lib/hashcode-mem.c, lib/hashcode-string2.c, lib/hashkey-string.c:
* lib/struniq.h, tests/test-array_map.c, tests/test-avltreehash_list.c:
* tests/test-hash_map.c, tests/test-linkedhash_list.c:
* tests/test-linkedhash_map.c, tests/test-rbtreehash_list.c:
(SIZE_BITS): Remove; no longer needed.
* modules/array-map-tests, modules/avltreehash-list-tests:
* modules/crypto/arctwo, modules/getlocalename_l-simple:
* modules/getlocalename_l-unsafe, modules/hash:
* modules/hash-map-tests, modules/hashcode-mem:
* modules/hashcode-string1, modules/hashcode-string2:
* modules/hashkey-string, modules/linkedhash-list-tests:
* modules/linkedhash-map-tests, modules/localename:
* modules/mem-hash-map, modules/rbtree-list-tests:
Depend on stdc_rotate_left.
Don’t depend on bitrotate, if we were depending on it.
* modules/bitrotate: Deprecate.
* modules/crypto/arctwo: Depend on stdc_rotate_right.

2 days agomkdtemp: Provide declaration in <stdlib.h>.
Bruno Haible [Fri, 26 Jun 2026 16:02:41 +0000 (18:02 +0200)] 
mkdtemp: Provide declaration in <stdlib.h>.

* lib/stdlib.in.h: Include <unistd.h> when needed for mkdtemp.
* doc/posix-functions/mkdtemp.texi: Document macOS bug.

2 days agofnmatch: Fix syntax error in C++ mode on CentOS 7.
Bruno Haible [Fri, 26 Jun 2026 14:42:01 +0000 (16:42 +0200)] 
fnmatch: Fix syntax error in C++ mode on CentOS 7.

* lib/fnmatch.in.h (fnmatch): Provide declaration of overridden fnmatch
function, needed for _GL_CXXALIASWARN.

3 days agodoc: Add reference to NetBSD bug.
Bruno Haible [Thu, 25 Jun 2026 19:54:41 +0000 (21:54 +0200)] 
doc: Add reference to NetBSD bug.

* doc/posix-functions/mbrtowc.texi: Add reference.
* doc/posix-functions/mbrlen.texi: Likewise.

3 days agofstatat: port null file support to Alpine 3.24
Paul Eggert [Thu, 25 Jun 2026 15:27:36 +0000 (08:27 -0700)] 
fstatat: port null file support to Alpine 3.24

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00093.html
* m4/fstatat.m4 (gl_FUNC_FSTATAT): When checking for
support for a null pointer file, check nonnegative directory
file descriptors as well as AT_FDCWD.

3 days agomanywarnings: Fix for compilers that are named '$host-gcc'.
Bruno Haible [Thu, 25 Jun 2026 13:45:24 +0000 (15:45 +0200)] 
manywarnings: Fix for compilers that are named '$host-gcc'.

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)): Use only the first line
of `$CC --version`. Allow $CC to be of the form '$host-gcc'.

4 days agosetlocale: Update a comment.
Bruno Haible [Wed, 24 Jun 2026 17:21:15 +0000 (19:21 +0200)] 
setlocale: Update a comment.

* lib/setlocale.c: Mention that gl_locale_name_from_win32_LANGID is now
defined in localename-unsafe.c instead of localename.c.

6 days agocrypto/af_alg: Deprecate.
Collin Funk [Tue, 23 Jun 2026 01:03:40 +0000 (18:03 -0700)] 
crypto/af_alg: Deprecate.

* modules/crypto/af_alg (Status, Notice): New sections.
(configure.ac): Add a module indicator.
* lib/md5-stream.c (md5_stream): Only use the AF_ALG API if the module
indicator is defined.
* lib/sha1-stream.c (sha1_stream): Likewise.
* lib/sha256-stream.c (shaxxx_stream): Likewise.
* lib/sha3-stream.c (sha3_xxx_stream): Likewise.
* lib/sha512-stream.c (shaxxx_stream): Likewise.
* modules/crypto/md5 (Depends-on): Remove crypto/af_alg dependency.
* modules/crypto/sha1 (Depends-on): Likewise.
* modules/crypto/sha256 (Depends-on): Likewise.
* modules/crypto/sha3 (Depends-on): Likewise.
* modules/crypto/sha512 (Depends-on): Likewise.
* NEWS: Mention the deprecation.

8 days agogethrxtime: don’t use nanouptime, microuptime
Paul Eggert [Sat, 20 Jun 2026 17:45:10 +0000 (10:45 -0700)] 
gethrxtime: don’t use nanouptime, microuptime

* lib/gethrxtime.c (gethrxtime): On platforms with
CLOCK_MONOTONIC, try it first.  If it fails, just fall back on
CLOCK_REALTIME as that’s what current_timespec would do anyway.
On platforms lacking CLOCK_MONOTONIC, just use current_timespec.
* m4/gethrxtime.m4 (gl_GETHRXTIME): Don’t check for microuptime or
nanouptime.  They aren’t exposed to user space by BSD kernels now,
and it’s not clear that they ever were.

9 days agofstatat: don’t mess with CFLAGS
Paul Eggert [Fri, 19 Jun 2026 17:07:47 +0000 (10:07 -0700)] 
fstatat: don’t mess with CFLAGS

* m4/fstatat.m4 (gl_FUNC_FSTATAT): Remove stray code left
over from an aborted attempt to mess with CFLAGS.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00084.html

9 days agoopenat2-tests: port to NFS
Paul Eggert [Fri, 19 Jun 2026 16:27:30 +0000 (09:27 -0700)] 
openat2-tests: port to NFS

* tests/test-openat2.c (do_test_basic): Close fd before
removing its file.  This fixes a file descriptor leak,
and ports the test to NFS, where removing an unclosed
file leaves behind a .nfs* file that prevents the
parent directory from being removed.

9 days agoopenat2: fix typo for circa-2012 Linux
Paul Eggert [Fri, 19 Jun 2026 16:17:04 +0000 (09:17 -0700)] 
openat2: fix typo for circa-2012 Linux

* lib/openat2.c (dirstat) [FSTAT_O_PATH_BUG]: Fix typo (a missing
arg) in workaround for this bug in Linux kernel 2.6.39 (2011)
through 3.5.7 (2012).  Evidently nobody compiles on these old
platforms, but we might as well fix the code if we’re going to
have it at all.

10 days agofstatat: support NULL if AT_EMPTY_PATH
Paul Eggert [Thu, 18 Jun 2026 20:33:58 +0000 (13:33 -0700)] 
fstatat: support NULL if AT_EMPTY_PATH

On platforms that define AT_EMPTY_PATH, allow a null pointer to be
passed as a file name.  This is GNU behavior as of glibc 2.41 +
Linux kernel 6.11, and can be supported on older kernels, older
glibcs, and on recent FreeBSD and z/OS.
* lib/fstatat.c (rpl_fstatat): Support AT_EMPTY_PATH,
if it exists, on null pointers.
* m4/fstatat.m4 (gl_FUNC_FSTATAT): Replace fstatat if
AT_EMPTY_PATH is defined but does not work on null pointers.
Also, define HAVE_WORKING_FSTATAT_ZERO_FLAG, if it is discovered,
regardless of whether replacing fstatat.  This refactoring makes
config.h a bit less confusing.
* tests/test-fstatat.c (main): Test AT_EMPTY_PATH if defined.

10 days ago* lib/stat-time.h: Fix comment.
Paul Eggert [Thu, 18 Jun 2026 17:38:36 +0000 (10:38 -0700)] 
* lib/stat-time.h: Fix comment.

10 days agofchmodat: fix AT_FDCWD + AT_EMPTY_PATH
Paul Eggert [Thu, 18 Jun 2026 16:29:15 +0000 (09:29 -0700)] 
fchmodat: fix AT_FDCWD + AT_EMPTY_PATH

* lib/fchmodat.c (fchmodat): When following symlinks and with
AT_FDCWD and an empty filename, don’t use fchmod as it will fail.
Instead, fall back on the usual orig_fchmodat call, as this does
the right thing if AT_EMPTY_PATH support is present there.
Using chmod (".", ...) wouldn’t be quite right here, as it would
go awry if the working directory is not searchable.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00068.html

10 days agostdbit-h: Work around syntax error in FreeBSD 15.1 <stdbit.h>.
Bruno Haible [Thu, 18 Jun 2026 09:42:21 +0000 (11:42 +0200)] 
stdbit-h: Work around syntax error in FreeBSD 15.1 <stdbit.h>.

* lib/stdbit.in.h (_Bool): Define on FreeBSD in C++ mode.
* doc/posix-headers/stdbit.texi: Mention the FreeBSD bug.

11 days agoopenat2: mention module in manual
Paul Eggert [Wed, 17 Jun 2026 13:40:41 +0000 (06:40 -0700)] 
openat2: mention module in manual

12 days agoopenat2: fix bug with trailing "/./"
Paul Eggert [Wed, 17 Jun 2026 07:19:35 +0000 (00:19 -0700)] 
openat2: fix bug with trailing "/./"

Problem reported by Kinan Al-Falakh in:
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00070.html
* lib/openat2.c (do_openat2): When opening a dotlike component at
file name end, also set the G and H indexes appropriately for ".".
This matters if the file name ends in something like "/./" so the
last component "." is not at file name end.
* tests/test-openat2.c (do_test_resolve): Test for the bug.

12 days agoopenat2: set HAVE_OPENAT2=0 if openat2 is missing
Paul Eggert [Wed, 17 Jun 2026 06:59:47 +0000 (23:59 -0700)] 
openat2: set HAVE_OPENAT2=0 if openat2 is missing

* m4/openat2.m4 (gl_FUNC_OPENAT2): The recent ‘fcntl-h: glibc now
has openat2’ patch changed HAVE_OPENAT2’s default to 1.  Adjust to
this here by setting it to 0 when openat2 is not found, rather than
setting it to 1 when it is found.

12 days agofaccessat: simplify latest change
Paul Eggert [Tue, 16 Jun 2026 19:08:19 +0000 (12:08 -0700)] 
faccessat: simplify latest change

Suggested by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00065.html
* lib/faccessat.c (LSTAT_FOLLOWS_SLASHED_SYMLINK): Remove.
(rpl_faccessat): Assume it’s false.

12 days agodoc: document AT_EMPTY_PATH glitches
Paul Eggert [Tue, 16 Jun 2026 16:46:38 +0000 (09:46 -0700)] 
doc: document AT_EMPTY_PATH glitches

12 days agofchownat: don’t mishandle AT_EMPTY_PATH
Paul Eggert [Tue, 16 Jun 2026 16:46:20 +0000 (09:46 -0700)] 
fchownat: don’t mishandle AT_EMPTY_PATH

This has the same motivation as the recent fchmodat change.
* lib/fchownat.c (AT_EMPTY_PATH): Default to 0.
(FCHOWNAT_EMPTY_FILENAME_BUG): Remove; no longer needed.
(rpl_fchownat): Do not mishandle AT_EMPTY_PATH if specified
and if the underlying library+kernel supports it.
* m4/fchownat.m4 (gl_FUNC_FCHOWNAT):
Don’t define FCHOWNAT_EMPTY_FILENAME_BUG, as it is no longer needed.

12 days agofchmodat: don’t mishandle AT_EMPTY_PATH
Paul Eggert [Tue, 16 Jun 2026 16:46:03 +0000 (09:46 -0700)] 
fchmodat: don’t mishandle AT_EMPTY_PATH

This does not add support for AT_EMPTY_PATH on platforms lacking it.
It merely fixes bugs in handling AT_EMPTY_PATH on platforms
that already have AT_EMPTY_PATH.  This is complicated by
the fact that glibc may define AT_EMPTY_PATH even though the
underlying kernel lacks support for it, and by the fact that
in recent kernels, AT_EMPTY_PATH allows the file name to be
a null pointer.
* lib/fchmodat.c (AT_EMPTY_PATH): Default to 0.
(rpl_fchmodat): Do not mishandle AT_EMPTY_PATH if specified
and if the underlying library+kernel supports it.

12 days agofstatat etc.: fix wrong machine code for calls
Paul Eggert [Tue, 16 Jun 2026 16:45:39 +0000 (09:45 -0700)] 
fstatat etc.: fix wrong machine code for calls

Without this fix, compilers can generate incorrect machine code
for functions that call to fstatat-like functions, as the
compilers incorrectly assume that the calls’ arguments cannot be
null pointers.  This assumption became false with the release of
Linux kernel 6.11 (2024).
* lib/sys_stat.in.h (fchmodat, fstatat, utimensat):
* lib/unistd.in.h (faccessat, fchownat): Do not mark file args
with _GL_ARG_NONNULL, as the args are allowed to be null pointers
in Linux kernel 6.11+, possibly with glibc 2.41+ involved.

12 days agoeuidaccess-tests: link with test_euidaccess_LDADD
Paul Eggert [Tue, 16 Jun 2026 16:45:18 +0000 (09:45 -0700)] 
euidaccess-tests: link with test_euidaccess_LDADD

* modules/euidaccess-tests (test_euidaccess_LDADD):
New macro.  Needed for Solaris 10.

12 days agofaccessat: support "" and NULL file
Paul Eggert [Tue, 16 Jun 2026 16:44:54 +0000 (09:44 -0700)] 
faccessat: support "" and NULL file

* lib/faccessat.c (LSTAT_FOLLOWS_SLASHED_SYMLINK): Default to 0.
(rpl_faccessat): Don’t mishandle empty string, or null pointer for
that matter.  Also, do not call fstatat if
LSTAT_FOLLOWS_SLASHED_SYMLINK, as there is no need in that case.

12 days agofcntl-h: glibc now has openat2
Paul Eggert [Tue, 16 Jun 2026 16:44:25 +0000 (09:44 -0700)] 
fcntl-h: glibc now has openat2

* m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): HAVE_OPENAT2 is now 1,
as glibc 2.43 (2026) supports it.

12 days agoopenat2: fix prereq typo
Paul Eggert [Tue, 16 Jun 2026 16:43:58 +0000 (09:43 -0700)] 
openat2: fix prereq typo

* modules/openat2 (configure.ac): Fix typo in spelling of prereq
for gl_PREREQ_OPENAT2.

12 days agosomehow lost x bit
Karl Berry [Tue, 16 Jun 2026 15:23:16 +0000 (08:23 -0700)] 
somehow lost x bit

13 days agoxstrtol tests: Fix link error on FreeBSD and macOS (regr. 2026-06-13).
Collin Funk [Tue, 16 Jun 2026 02:36:06 +0000 (19:36 -0700)] 
xstrtol tests: Fix link error on FreeBSD and macOS (regr. 2026-06-13).

* modules/xstrtol-tests (Makefile.am): Link the test programs to
$(LIBUNISTRING), $(MBRTOWC_LIB), and $(LIBC32CONV).
* modules/xstrtoimax-tests (Makefile.am): Likewise.
* modules/xstrtoumax-tests (Makefile.am): Likewise.
* modules/xstrtoll-tests (Makefile.am): Likewise. Use @LIBINTL@ instead
of $(LIBINTL).

13 days agolocaleconv: Fix compilation error on mingw (regression 2026-06-08).
Bruno Haible [Mon, 15 Jun 2026 22:22:16 +0000 (00:22 +0200)] 
localeconv: Fix compilation error on mingw (regression 2026-06-08).

* lib/locale.in.h (GNULIB_defined_localeconv): Define to 1, not empty.

13 days agoautoupdate
Karl Berry [Mon, 15 Jun 2026 13:31:40 +0000 (06:31 -0700)] 
autoupdate

2 weeks agoFix a typo in the previous ChangeLog entry.
Collin Funk [Sun, 14 Jun 2026 02:20:15 +0000 (19:20 -0700)] 
Fix a typo in the previous ChangeLog entry.

2 weeks agoxstrtol-error: Use quote() before print command line arguments.
Collin Funk [Fri, 12 Jun 2026 00:23:50 +0000 (17:23 -0700)] 
xstrtol-error: Use quote() before print command line arguments.

* lib/xstrtol-error.c: Include quote.h.
(xstrtol_error): Adjust the format strings and call quote() before
printing the argument.

2 weeks agostrerror: Detect invalid writes to the returned string in some cases.
Bruno Haible [Mon, 8 Jun 2026 09:46:56 +0000 (11:46 +0200)] 
strerror: Detect invalid writes to the returned string in some cases.

* lib/string.in.h (strerror): Change the return type to 'const char *'.
(GNULIB_defined_strerror): New macro.
* lib/strerror.c (strerror): Change the return type to 'const char *'.
* lib/strerror_l.c (errno_string_callback): Change a variable from
'char *' to 'const char *'.
* lib/strerror_r.c (strerror_r): Likewise.
* doc/posix-functions/strerror.texi: Document that Gnulib uses the
return type 'const char *'.
* NEWS: Mention the change.
* m4/perror.m4 (gl_FUNC_PERROR): Change a variable from 'char *' to
'const char *'.
* m4/strerror.m4 (gl_FUNC_STRERROR_0): Likewise.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R_WORKS): Likewise.
* tests/test-strerror.c (strerror): Update expected signature.
(main): Change a variable from 'char *' to 'const char *'.
* tests/test-string-h-c++.cc (GNULIB_NAMESPACE::strerror): Update
expected signature.

2 weeks agolocaleconv: Detect invalid writes to the returned struct in some cases.
Bruno Haible [Mon, 8 Jun 2026 10:57:03 +0000 (12:57 +0200)] 
localeconv: Detect invalid writes to the returned struct in some cases.

* lib/locale.in.h (localeconv): Change the return type to
'const struct lconv *'.
(GNULIB_defined_localeconv): New macro.
* lib/localeconv.c (localeconv): Change the return type to
'const struct lconv *'. Change a variable from 'struct lconv *' to
'const struct lconv *'.
* doc/posix-functions/localeconv.texi: Document that Gnulib uses the
return type 'const struct lconv *'.
* NEWS: Mention the change.
* m4/localeconv.m4 (gl_FUNC_LOCALECONV): Change a variable from
'struct lconv *' to 'const struct lconv *'.
* tests/test-localeconv.c (localeconv): Update expected signature.
(main): Change a variable from 'struct lconv *' to
'const struct lconv *'.
* tests/test-locale-h-c++.cc (GNULIB_NAMESPACE::localeconv): Update
expected signature.

2 weeks agosetlocale: Avoid a portability pitfall through the last patch.
Bruno Haible [Mon, 8 Jun 2026 14:01:36 +0000 (16:01 +0200)] 
setlocale: Avoid a portability pitfall through the last patch.

* lib/locale.in.h (setlocale): Cast the return value to 'const char *'
on the other platforms.
* NEWS: Update.

3 weeks agoreadlinkat: document GNU/Linux "" divergence
Paul Eggert [Sun, 7 Jun 2026 19:11:49 +0000 (12:11 -0700)] 
readlinkat: document GNU/Linux "" divergence

3 weeks agosetlocale: Detect invalid writes to the returned string in some cases.
Bruno Haible [Sun, 7 Jun 2026 12:57:38 +0000 (14:57 +0200)] 
setlocale: Detect invalid writes to the returned string in some cases.

* lib/locale.in.h (setlocale): Change the return type to 'const char *'.
* lib/setlocale.c (setlocale_mtsafe, setlocale_unixlike): Change the
return type to 'const char *'. Remove a cast.
(setlocale_single): Change the return type to 'const char *'.
(setlocale_improved): Change the return type to 'const char *'. Change
three variables from 'char *' to 'const char *'. Add local variable
old_locale.
* lib/localcharset.c (locale_charset): Change two variables from
'char *' to 'const char *'.
* doc/posix-functions/setlocale.texi: Document that Gnulib uses the
return type 'const char *'.
* NEWS: Mention the change.
* m4/mbrtowc.m4 (gl_MBRTOWC_C_LOCALE): Change a variable from 'char *'
to 'const char *'.
* m4/mbrtoc32.m4 (gl_MBRTOC32_C_LOCALE, gl_MBRTOC32_UTF8_LOCALE):
Likewise.
* m4/mbrtoc16.m4 (gl_MBRTOC16_C_LOCALE): Likewise.
* tests/test-setlocale-w32utf8.c (main): Likewise.
* tests/test-setlocale1.c (setlocale): Update expected signature.
* tests/test-locale-h-c++.cc (GNULIB_NAMESPACE::setlocale): Likewise.

3 weeks agotests: Avoid conflict between mingw standard C++ library and Gnulib.
Bruno Haible [Sun, 7 Jun 2026 12:50:49 +0000 (14:50 +0200)] 
tests: Avoid conflict between mingw standard C++ library and Gnulib.

* doc/multithread.texi (Gnulib multithreading): Document an
incompatibility.
* tests/test-assert-h-c++.cc: Skip the standard C++ library on mingw,
when configured with --enable-threads=windows.
* tests/test-assert-h-c++2.cc: Likewise.
* tests/test-endian-c++.cc: Likewise.
* tests/test-nullptr-c++.cc: Likewise.
* tests/test-stdalign-h-c++.cc: Likewise.
* tests/test-stdbit-h-c++.cc: Likewise.
* tests/test-wchar-h-c++3.cc: Likewise.

3 weeks agointprops, stdbit-h: Fix error on MSVC in C++ mode (regr. 2024-12-19).
Bruno Haible [Sun, 7 Jun 2026 10:27:28 +0000 (12:27 +0200)] 
intprops, stdbit-h: Fix error on MSVC in C++ mode (regr. 2024-12-19).

* lib/intprops-internal.h (_GL_HAVE___TYPEOF__): Set to 0 on MSVC in
C++ mode.
* lib/stdbit.in.h (_GL_STDBIT_TYPEOF_CAST): Don't use __typeof__ on MSVC
in C++ mode.

3 weeks agombrtowc: Fix handling of s==NULL on all possible platforms.
Bruno Haible [Sat, 6 Jun 2026 19:04:18 +0000 (21:04 +0200)] 
mbrtowc: Fix handling of s==NULL on all possible platforms.

* lib/mbrtowc.c (rpl_mbrtowc): Enable the s==NULL test also on platforms
that define only MBRTOWC_NUL_RETVAL_BUG or
MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ.

3 weeks agombrtoc32: fix ChangeLog typo
Paul Eggert [Sat, 6 Jun 2026 17:41:07 +0000 (10:41 -0700)] 
mbrtoc32: fix ChangeLog typo

Problem reported by Tim Rühsen in:
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00018.html

3 weeks agoquotearg: fix ChangeLog typo
Paul Eggert [Fri, 5 Jun 2026 18:33:15 +0000 (11:33 -0700)] 
quotearg: fix ChangeLog typo

Problem reported by Pavel Cahyna in
https://lists.gnu.org/r/bug-gnulib/2026-06/msg00015.html

3 weeks agombrtowc: Work around a NetBSD bug in UTF-8 locales, part 2.
Bruno Haible [Tue, 2 Jun 2026 20:17:38 +0000 (22:17 +0200)] 
mbrtowc: Work around a NetBSD bug in UTF-8 locales, part 2.

* m4/mbsrtowcs.m4 (gl_FUNC_MBSRTOWCS): Also set REPLACE_MBSRTOWCS
to 1 if gl_MBRTOWC_INVALID_UTF8 reports "no".
* m4/mbsnrtowcs.m4 (gl_FUNC_MBSNRTOWCS): Also set REPLACE_MBSNRTOWCS
to 1 if gl_MBRTOWC_INVALID_UTF8 reports "no".

3 weeks agoc32width etc.: Fix compilation error on GNU systems (regr. 2026-04-24).
Bruno Haible [Tue, 2 Jun 2026 19:16:31 +0000 (21:16 +0200)] 
c32width etc.: Fix compilation error on GNU systems (regr. 2026-04-24).

* lib/uchar.in.h: Do include <wchar.h> when any of the modules c32width,
c32snrtombs, c32srtombs, c32swidth, mbsnrtoc32s, mbsrtoc32s is in use.

3 weeks agoautoupdate
Karl Berry [Tue, 2 Jun 2026 14:43:36 +0000 (07:43 -0700)] 
autoupdate

3 weeks agombrtowc: Fix handling of n==0 on CentOS 7, MSVC (regr. 2026-05-25).
Bruno Haible [Tue, 2 Jun 2026 12:14:09 +0000 (14:14 +0200)] 
mbrtowc: Fix handling of n==0 on CentOS 7, MSVC (regr. 2026-05-25).

* lib/mbrtowc.c (rpl_mbrtowc): Fix botched condition for the n==0 case.

3 weeks agombrtowc, mbrlen: Work around a NetBSD bug in UTF-8 locales.
Bruno Haible [Tue, 2 Jun 2026 11:13:20 +0000 (13:13 +0200)] 
mbrtowc, mbrlen: Work around a NetBSD bug in UTF-8 locales.

* m4/mbrtowc.m4 (gl_MBRTOWC_INVALID_UTF8): New macro.
(gl_FUNC_MBRTOWC): Invoke it. Define MBRTOWC_INVALID_UTF8_BUG if mbrtowc
does not recognize some invalid UTF-8 byte sequences.
* lib/mbrtowc.c (is_locale_utf8, is_locale_utf8_cached): Define also if
MBRTOWC_INVALID_UTF8_BUG.
(rpl_mbrtowc): Handle UTF-8 locales specially also on NetBSD.
* tests/test-mbrtowc.c (main): Add more test cases for the UTF-8
encoding.
* tests/test-mbrlen.c (main): Likewise.
* doc/posix-functions/mbrtowc.texi: Mention the NetBSD bug.
* doc/posix-functions/mbrlen.texi: Likewise.

4 weeks agoautoupdate
Karl Berry [Sun, 31 May 2026 14:39:50 +0000 (07:39 -0700)] 
autoupdate

4 weeks agoparse-datetime: INT_BITS → INT_WIDTH in comments
Paul Eggert [Sun, 31 May 2026 07:33:08 +0000 (00:33 -0700)] 
parse-datetime: INT_BITS → INT_WIDTH in comments

4 weeks agoquotearg: remove SIZE_MAX, INT_BITS
Paul Eggert [Sun, 31 May 2026 07:32:30 +0000 (00:32 -0700)] 
quotearg: remove SIZE_MAX, INT_BITS

This is a minor cleanup, as quotearg can assume
* modules/quotearg (Depends-on): Add limits-h.
* lib/quotearg.c (SIZE_MAX): Remove; <stdint.h> defines this now.
(INT_BITS): Remove.  All uses replaced by UINT_WIDTH,
which <limits.h> defines.

4 weeks agofree-posix: remove stray wchar-h dependency
Paul Eggert [Sun, 31 May 2026 06:21:52 +0000 (23:21 -0700)] 
free-posix: remove stray wchar-h dependency

* modules/free-posix (Depends-on): Don’t depend on wchar-h.
Discovered because gzip unnecessarily brought in wchar-h machinery.

4 weeks agoquotearg: escape C1 codes in C locale
Paul Eggert [Sun, 31 May 2026 04:57:03 +0000 (21:57 -0700)] 
quotearg: escape C1 codes in C locale

Problem reported by Lasse Collin <https://bugs.gnu.org/81135#29>.
For lib/quotearg.c, m4/quotearg.m4 and modules/quotearg,
go back to the old way of doing things, without the recently-added
USE_C_LOCALE stuff.  Then make the following changes instead:
* lib/quotearg.c [_QUOTEARG_AVOID_UCHAR_H]: Don’t include <uchar.h>.
(mbrto2c, mbstate_t) [_QUOTEARG_AVOID_UCHAR_H && defined __UCLIBC__
&& !defined __UCLIBC_HAS_WCHAR__]: New macros.
Also, don’t include <wchar.h> or <wctype.h>.
(char32_t, c32isprint, mbrtoc32, GNULIB_MBRTOC32_REGULAR)
[_QUOTEARG_AVOID_UCHAR_H]: New macros.
(mbszero) [!GNULIB_defined_mbszero]: New macro.

4 weeks agoquotearg: improve USE_C_LOCALE + UTF-8
Paul Eggert [Fri, 29 May 2026 20:56:42 +0000 (13:56 -0700)] 
quotearg: improve USE_C_LOCALE + UTF-8

Problem reported by Bruno Haible <https://bugs.gnu.org/81135>.
* lib/quotearg.c (chisprint, wchisprint) [USE_C_LOCALE]:
Treat unassigned characters as printable.

4 weeks agomanywarnings: deprecate -Whsa etc. too
Paul Eggert [Fri, 29 May 2026 00:48:00 +0000 (17:48 -0700)] 
manywarnings: deprecate -Whsa etc. too

-Whsa, -Wunreachable-code and -Wunsafe-loop-optimizations
are now ignored, so stop worrying about them too.

4 weeks agomanywarnings: -Wstrict-overflow is deprecated
Paul Eggert [Thu, 28 May 2026 20:27:01 +0000 (13:27 -0700)] 
manywarnings: -Wstrict-overflow is deprecated

Issue reported by Drea Pinski in:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101913#c6
* HACKING: Stop recommending -Wstrict-overflow.
* build-aux/g++-warning.spec:
* build-aux/gcc-warning.spec: Say -Wstrict-overflow is deprecated.
* doc/manywarnings.texi (manywarnings): Stop mentioning it.
* m4/manywarnings-c++.m4 (gl_MANYWARN_ALL_GCC_CXX_IMPL):
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
Stop using it.

4 weeks agofma: Work around glibc 2.43 regression.
Bruno Haible [Wed, 27 May 2026 17:08:16 +0000 (19:08 +0200)] 
fma: Work around glibc 2.43 regression.

* m4/fma.m4 (gl_FUNC_FMA_WORKS): Check against glibc 2.43 bug.
* doc/posix-functions/fma.texi: Mention glibc 2.43 as being buggy.

4 weeks agolibgmp-mpz: pacify -Wuseless-cast
Paul Eggert [Wed, 27 May 2026 05:17:29 +0000 (22:17 -0700)] 
libgmp-mpz: pacify -Wuseless-cast

* lib/mini-gmp-gnulib.c: Ignore -Wuseless-cast, as we
don’t want top change lib/mini-gmp.c.

4 weeks agoquotearg: Fix compilation error in USE_C_LOCALE code.
Bruno Haible [Tue, 26 May 2026 18:35:50 +0000 (20:35 +0200)] 
quotearg: Fix compilation error in USE_C_LOCALE code.

* lib/quotearg.c: If USE_C_LOCALE && C_LOCALE_MIGHT_BE_MULTIBYTE,
include c-ctype.h instead of <ctype.h>.
* modules/quotearg (Depends-on): Add c-ctype.

4 weeks agoquotearg: Improve USE_C_LOCALE code on Haiku.
Bruno Haible [Tue, 26 May 2026 17:49:09 +0000 (19:49 +0200)] 
quotearg: Improve USE_C_LOCALE code on Haiku.

* lib/quotearg.c (C_LOCALE_MIGHT_BE_MULTIBYTE): Define also on Haiku.
Add comments.

4 weeks agoquotearg: Improve USE_C_LOCALE code on musl libc.
Bruno Haible [Tue, 26 May 2026 17:40:43 +0000 (19:40 +0200)] 
quotearg: Improve USE_C_LOCALE code on musl libc.

* m4/quotearg.m4 (gl_QUOTEARG): Require gl_MUSL_LIBC.
* modules/quotearg (Files): Add m4/musl.m4.

4 weeks agoautoupdate
Karl Berry [Tue, 26 May 2026 14:23:39 +0000 (07:23 -0700)] 
autoupdate

4 weeks agoxalloc-oversized: pacify gcc -Wuseless-cast
Paul Eggert [Tue, 26 May 2026 03:09:50 +0000 (20:09 -0700)] 
xalloc-oversized: pacify gcc -Wuseless-cast

* lib/xalloc-oversized.h (xalloc_oversized): 1 → 1u.

4 weeks agoquotearg: be nicer on macOS etc
Paul Eggert [Tue, 26 May 2026 00:08:48 +0000 (17:08 -0700)] 
quotearg: be nicer on macOS etc

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-05/msg00150.html
* lib/quotearg.c (C_LOCALE_MIGHT_BE_MULTIBYTE): New macro.
(wch, mbstate, mbs_clear, mbrtowch, chisprint, wchisprint
(quotearg_buffer_restyled): Fall back on <wchar.h> and <wctype.h>
functions if USE_C_LOCALE and C_LOCALE_MIGHT_BE_MULTIBYTE.

4 weeks agoFix ChangeLog to match recent commit message
Paul Eggert [Tue, 26 May 2026 00:06:42 +0000 (17:06 -0700)] 
Fix ChangeLog to match recent commit message

4 weeks agombuiterf: Implement multi-byte per encoding error (MEE) consistently.
Bruno Haible [Mon, 25 May 2026 23:29:29 +0000 (01:29 +0200)] 
mbuiterf: Implement multi-byte per encoding error (MEE) consistently.

* lib/mbuiterf.h: Include mbiter-aux.h.
(struct mbuif_state): Add field is_utf8.
(mbuiterf_next): Invoke mbiter_is_utf8, mbiter_utf8_maximal_subpart.
(mbuif_init): Initialize the field is_utf8.
* modules/mbuiterf (Depends-on): Add mbiter-aux.
* tests/test-mbslen.c (OR): New macro, copied from
tests/test-mbsnlen.c.
(main): Add more test cases with incomplete characters.
* tests/test-mbschr2.sh: Renamed from tests/test-mbschr.sh.
* tests/test-mbschr2.c: Renamed from tests/test-mbschr.c.
* tests/test-mbschr1.sh: New file, based on
tests/test-mbmemcasecmp-3.sh.
* tests/test-mbschr1.c: New file.
* modules/mbschr-tests (Files): Update accordingly. Add locale-en.m4,
locale-fr.m4.
(configure.ac): Invoke gt_LOCALE_EN_UTF8, gt_LOCALE_FR_UTF8.
(Makefile.am): Arrange to compile test-mbschr1 and test-mbschr2 and to
run test-mbschr1.sh, test-mbschr2.sh.
* tests/test-mbsrchr2.sh: Renamed from tests/test-mbsrchr.sh.
* tests/test-mbsrchr2.c: Renamed from tests/test-mbsrchr.c.
* tests/test-mbsrchr1.sh: New file, based on
tests/test-mbmemcasecmp-3.sh.
* tests/test-mbsrchr1.c: New file.
* modules/mbsrchr-tests (Files): Update accordingly. Add locale-en.m4,
locale-fr.m4.
(configure.ac): Invoke gt_LOCALE_EN_UTF8, gt_LOCALE_FR_UTF8.
(Makefile.am): Arrange to compile test-mbsrchr1 and test-mbsrchr2 and to
run test-mbsrchr1.sh, test-mbsrchr2.sh.
* tests/test-mbscspn.c (OR): New macro, copied from
tests/test-mbsnlen.c.
(main): Add test cases with incomplete characters.
* tests/test-mbspbrk.c (OR): New macro, copied from
tests/test-mbsnlen.c.
(main): Add test cases with incomplete characters.
* tests/test-mbsspn.c (OR): New macro, copied from
tests/test-mbsnlen.c.
(main): Add test cases with incomplete characters.

4 weeks agombuiter: Implement multi-byte per encoding error (MEE) consistently.
Bruno Haible [Mon, 25 May 2026 22:53:31 +0000 (00:53 +0200)] 
mbuiter: Implement multi-byte per encoding error (MEE) consistently.

* lib/mbuiter.h: Include mbiter-aux.h.
(struct mbuiter_multi): Add field is_utf8.
(mbuiter_multi_next): Invoke mbiter_is_utf8,
mbiter_utf8_maximal_subpart.
(mbui_init): Initialize the field is_utf8.
* modules/mbuiter (Depends-on): Add mbiter-aux.
* tests/test-mbsstr2.c (OR): New macro, copied from
tests/test-mbsnlen.c.
(main): Add test cases with incomplete characters.
* tests/test-mbsstr1.c: Update comments.
* tests/test-mbsstr3.c: Likewise.
* tests/test-mbscasestr2.c (OR): New macro, copied from
tests/test-mbsnlen.c.
(main): Add test cases with incomplete characters.
* tests/test-mbscasestr1.c: Update comments.
* tests/test-mbscasestr3.c: Likewise.
* tests/test-mbscasestr4.c: Likewise.

4 weeks agombiterf: Implement multi-byte per encoding error (MEE) consistently.
Bruno Haible [Mon, 25 May 2026 22:42:39 +0000 (00:42 +0200)] 
mbiterf: Implement multi-byte per encoding error (MEE) consistently.

* lib/mbiterf.h: Include mbiter-aux.h.
(struct mbif_state): Add field is_utf8.
(mbiterf_next): Invoke mbiter_is_utf8, mbiter_utf8_maximal_subpart.
(mbif_init): Initialize the field is_utf8.
* modules/mbiterf (Depends-on): Add mbiter-aux.
* tests/test-mbsnlen.c (main): Add test cases with incomplete characters
not at the end of the string.

4 weeks agombiter: Implement multi-byte per encoding error consistently.
Bruno Haible [Mon, 25 May 2026 17:06:55 +0000 (19:06 +0200)] 
mbiter: Implement multi-byte per encoding error consistently.

* lib/mbiter.h: Include mbiter-aux.h.
(struct mbiter_multi): Add field is_utf8.
(mbiter_multi_next): Invoke mbiter_is_utf8, mbiter_utf8_maximal_subpart.
(mbi_init): Initialize the field is_utf8.
* modules/mbiter (Depends-on): Add mbiter-aux.
* tests/test-mbs_startswith2.c (main): Add test cases with incomplete
characters not at the end of the string.
* tests/test-mbs_endswith2.c (OR): New macro, copied from
tests/test-mbsnlen.c.
(main): Add test cases with incomplete characters not at the end of the
string.

4 weeks agombiter-aux: New module.
Bruno Haible [Mon, 25 May 2026 16:58:12 +0000 (18:58 +0200)] 
mbiter-aux: New module.

* lib/mbiter-aux.h: New file.
* lib/mbiter-aux.c: New file. mbiter_is_utf8 is based on
lib/localeinfo.c.
* modules/mbiter-aux: New file.

4 weeks agombrtoc32, mbrtowc: do not optimze for uClibc-ng
Paul Eggert [Mon, 25 May 2026 18:37:32 +0000 (20:37 +0200)] 
mbrtoc32, mbrtowc: do not optimze for uClibc-ng

Problem reported by Waldemar Brodkorb in:
https://lists.gnu.org/r/bug-gnulib/2026-05/msg00145.html
* lib/mbrtoc32.c (mbrtoc32):
* lib/mbrtowc.c (rpl_mbrtowc):
Treat uClibc-ng as non-glibc.

4 weeks agoquotearg: support USE_C_LOCALE variant
Paul Eggert [Mon, 25 May 2026 21:30:05 +0000 (14:30 -0700)] 
quotearg: support USE_C_LOCALE variant

This is for gzip, which does not use setlocale,
but does need to quote file names.
* lib/quotearg.c (USE_C_LOCALE): Default to 0.  If set, include
c-ctype.h instead of ctype.h, gettext.h, uchar.h, wchar.h; and
define _ to be an identity macro.
(wch, mbstate): New types.
(mbs_clear, mbrtowch, wchisprint, chisprint): New functions.
(gettext_quote, quotearg_buffer_restyled): Use them.

4 weeks agoquotearg: lessen dependencies
Paul Eggert [Mon, 25 May 2026 18:32:32 +0000 (11:32 -0700)] 
quotearg: lessen dependencies

* lib/quotearg.c: Do not include c-strcaseeq.h, as its
macros are no longer used here.
* modules/quotearg (Depends-on): Remove c-strcaseeq.
Also remove memcmp, since the code no longer uses memcmp.

4 weeks agodiffseq: pacify gcc -Wusless-cast
Paul Eggert [Mon, 25 May 2026 18:31:06 +0000 (11:31 -0700)] 
diffseq: pacify gcc -Wusless-cast

* lib/diffseq.h (OFFSET_MAX): Pacify when OFFSET is int.

4 weeks agotrim tests: Enhance tests.
Bruno Haible [Mon, 25 May 2026 16:37:25 +0000 (18:37 +0200)] 
trim tests: Enhance tests.

* tests/test-trim.c (main): Add test cases with incomplete characters.

4 weeks agombmemcasecmp tests: Enhance tests.
Bruno Haible [Mon, 25 May 2026 16:36:12 +0000 (18:36 +0200)] 
mbmemcasecmp tests: Enhance tests.

* tests/test-mbmemcasecmp.h (test_utf_8): Add test cases with incomplete
characters.

4 weeks agombspcasecmp tests: Enhance tests.
Bruno Haible [Mon, 25 May 2026 16:32:18 +0000 (18:32 +0200)] 
mbspcasecmp tests: Enhance tests.

* tests/test-mbspcasecmp.c (test_ascii): New function, extracted from
main.
(test_utf_8): Likewise. Add test cases with incomplete characters.
(main): Invoke them. Accept a numeric argument.
* tests/test-mbspcasecmp-4.sh: Renamed from tests/test-mbspcasecmp.sh.
* tests/test-mbspcasecmp-3.sh: New file, based on
tests/test-mbmemcasecmp-3.sh.
* modules/mbspcasecmp-tests (Files): Update after rename. Add
locale-en.m4, locale-fr.m4.
(configure.ac): Invoke gt_LOCALE_EN_UTF8, gt_LOCALE_FR_UTF8.
(Makefile.am): Arrange to run test-mbspcasecmp-3.sh,
test-mbspcasecmp-4.sh, instead of test-mbspcasecmp.sh.

4 weeks agombsncasecmp tests: Enhance tests.
Bruno Haible [Mon, 25 May 2026 16:27:18 +0000 (18:27 +0200)] 
mbsncasecmp tests: Enhance tests.

* tests/test-mbsncasecmp.c (test_ascii): New function, extracted from
main.
(test_utf_8): Likewise. Add test cases with incomplete characters.
(main): Invoke them. Accept a numeric argument.
* tests/test-mbsncasecmp-4.sh: Renamed from tests/test-mbsncasecmp.sh.
* tests/test-mbsncasecmp-3.sh: New file, based on
tests/test-mbmemcasecmp-3.sh.
* modules/mbsncasecmp-tests (Files): Update after rename. Add
locale-en.m4, locale-fr.m4.
(configure.ac): Invoke gt_LOCALE_EN_UTF8, gt_LOCALE_FR_UTF8.
(Makefile.am): Arrange to run test-mbsncasecmp-3.sh,
test-mbsncasecmp-4.sh, instead of test-mbsncasecmp.sh.

4 weeks agombscasecmp tests: Enhance tests.
Bruno Haible [Mon, 25 May 2026 16:20:40 +0000 (18:20 +0200)] 
mbscasecmp tests: Enhance tests.

* tests/test-mbscasecmp.c (test_ascii): New function, extracted from
main.
(test_utf_8): Likewise. Add test cases with incomplete characters.
(main): Invoke them. Accept a numeric argument.
* tests/test-mbscasecmp-4.sh: Renamed from tests/test-mbscasecmp.sh.
* tests/test-mbscasecmp-3.sh: New file, based on
tests/test-mbmemcasecmp-3.sh.
* modules/mbscasecmp-tests (Files): Update after rename. Add
locale-en.m4, locale-fr.m4.
(configure.ac): Invoke gt_LOCALE_EN_UTF8, gt_LOCALE_FR_UTF8.
(Makefile.am): Arrange to run test-mbscasecmp-3.sh,
test-mbscasecmp-4.sh, instead of test-mbscasecmp.sh.

4 weeks agombs_endswith tests: Enhance tests.
Bruno Haible [Mon, 25 May 2026 15:56:44 +0000 (17:56 +0200)] 
mbs_endswith tests: Enhance tests.

* tests/test-mbs_endswith2.c (main): Add more test cases. Add more
comments.
* tests/test-mbs_endswith1.c: Update comments.
* tests/test-mbs_endswith3.c: Likewise.

4 weeks agombs_startswith tests: Enhance tests.
Bruno Haible [Mon, 25 May 2026 15:55:56 +0000 (17:55 +0200)] 
mbs_startswith tests: Enhance tests.

* tests/test-mbs_startswith2.c (OR): New macro, copied from
tests/test-mbsnlen.c.
(main): Add more test cases. Add more comments.
* tests/test-mbs_startswith1.c: Update comments.
* tests/test-mbs_startswith3.c: Likewise.

5 weeks agoregex: pacify 16.1.1 -Wanalyzer-out-of-bounds
Paul Eggert [Sun, 24 May 2026 17:48:54 +0000 (10:48 -0700)] 
regex: pacify 16.1.1 -Wanalyzer-out-of-bounds

* lib/regex_internal.c (re_node_set_insert): Add a DEBUG_ASSERT.
Needed for gcc 16.1.1 20260515 (Red Hat 16.1.1-2) on x86-64 when
_REGEX_AVOID_UCHAR_H is defined.

5 weeks agoregex: new _REGEX_AVOID_UCHAR_H option
Paul Eggert [Sun, 24 May 2026 17:44:42 +0000 (10:44 -0700)] 
regex: new _REGEX_AVOID_UCHAR_H option

This is for GNU Emacs, where the regex code is only auxiliary,
probably not enough to justify the hassle of incorporating
Gnulib’s uchar-h module and its dependencies.
The following changes are in effect only if _REGEX_AVOID_UCHAR_H,
and cause the code to avoid the need for Gnulib’s uchar-h module.
* lib/regcomp.c: Don’t include localeinfo.h.
(re_set_fastmap_icase): Don’t use localeinfo.h functions,
as they rely on char32_t.
* lib/regex_internal.h: Just use of wchar_t, wctype_t and related
functions, instead of using char32_t and related functions.

5 weeks agoregex-tests: omit unused parts
Paul Eggert [Fri, 22 May 2026 15:44:12 +0000 (08:44 -0700)] 
regex-tests: omit unused parts

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-05/msg00137.html
* tests/test-regex-en.c (tests, bug_regex11): Remove; unused.
* tests/test-regex-en.c, tests/test-regex-tr.c, tests/test-regex.c:
(main): Omit unused args.

5 weeks agodoc: Update for OpenBSD 7.9.
Bruno Haible [Fri, 22 May 2026 10:13:51 +0000 (12:13 +0200)] 
doc: Update for OpenBSD 7.9.

* doc/posix-headers/*.texi: Update.
* doc/pastposix-headers/*.texi: Update.
* doc/glibc-headers/*.texi: Likewise.
* doc/posix-functions/*.texi: Likewise.
* doc/pastposix-functions/*.texi: Likewise.
* doc/glibc-functions/*.texi: Likewise.

5 weeks agothread-optim: Add some optional rudimentary logging.
Bruno Haible [Tue, 19 May 2026 00:17:49 +0000 (02:17 +0200)] 
thread-optim: Add some optional rudimentary logging.

* lib/thread-optim.c (DEBUG_ELF, dbg_printf): New macros.
(inspect_one_GOT): Log the return value through dbg_printf.
(gl_multithreaded): Log the override through dbg_printf.

5 weeks agoterm-style-control: Make multithread-safe, part 6: Link dependencies.
Bruno Haible [Mon, 18 May 2026 23:52:40 +0000 (01:52 +0200)] 
term-style-control: Make multithread-safe, part 6: Link dependencies.

* m4/pthread_kill.m4: New file.
* modules/term-style-control (Files): Add it.
(configure.ac): Invoke gl_FUNC_PTHREAD_KILL.
(Link): Add $(PTHREAD_SIGMASK_LIB) and $(PTHREAD_KILL_LIB).
* modules/term-style-control-tests (Makefile.am): Link
test-term-style-control-hello and test-term-style-control-yes with
$(PTHREAD_SIGMASK_LIB) and $(PTHREAD_KILL_LIB).

5 weeks agofree-posix: Omit wrapper in musl libc >= 1.2.3.
Alyssa Ross [Mon, 18 May 2026 19:43:45 +0000 (21:43 +0200)] 
free-posix: Omit wrapper in musl libc >= 1.2.3.

* m4/free.m4 (gl_FUNC_FREE): Require gl_MUSL_LIBC. Guess yes on musl
libc versions that define SEEK_DATA.
* modules/free-posix (Files): Add m4/musl.m4.

Copyright-paperwork-exempt: Yes

5 weeks agothread-optim tests: Fix a test failure with --disable-threads.
Bruno Haible [Mon, 18 May 2026 19:21:34 +0000 (21:21 +0200)] 
thread-optim tests: Fix a test failure with --disable-threads.

* tests/test-thread-optim2.c: Skip the test if multithreading is not
enabled.

6 weeks agoterm-style-control: Make multithread-safe, part 5: SIGCONT handler.
Bruno Haible [Mon, 18 May 2026 08:40:20 +0000 (10:40 +0200)] 
term-style-control: Make multithread-safe, part 5: SIGCONT handler.

* lib/term-style-control.c (stopped_controller, stopped_user_data,
stopped_signal_handler_needs_reinstall): New variables.
(stopping_signal_handler): Set these variables.
(continuing_signal_handler): Use these variables instead of
active_controller and active_control_data, that may already be NULL
at this point.
(activate_term_style_controller): Initialize
stopped_signal_handler_needs_reinstall.

6 weeks agoterm-style-control: Make multithread-safe, part 4: Redirect signals.
Bruno Haible [Mon, 18 May 2026 08:33:54 +0000 (10:33 +0200)] 
term-style-control: Make multithread-safe, part 4: Redirect signals.

* lib/term-style-control.c (active_thread): New variable.
(fatal_signal_handler, stopping_signal_handler): Redirect the signal
from the current thread to the active_thread.
(activate_term_non_default_mode): Initialize active_thread.
(deactivate_term_non_default_mode): Reset active_thread to NULL.

6 weeks agoterm-style-control: Make multithread-safe, part 3: Use sigdelay.
Bruno Haible [Mon, 18 May 2026 08:17:08 +0000 (10:17 +0200)] 
term-style-control: Make multithread-safe, part 3: Use sigdelay.

* lib/term-style-control.h (struct term_style_control_data): Add field
'multithreaded'.
* lib/term-style-control.c: Include thread-optim.h, sigdelay.h.
(block_relevant_signals, unblock_relevant_signals): Add a
'multithreaded' parameter.
(fatal_or_stopping_signal_handler, continuing_signal_handler,
activate_term_non_default_mode, deactivate_term_non_default_mode):
Update.
(activate_term_style_controller): Determine whether the process is
multithreaded.
* modules/term-style-control (Depends-on): Add thread-optim, sigdelay.