]> git.ipfire.org Git - thirdparty/gnulib.git/log
thirdparty/gnulib.git
10 days agoreadtokens: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 12:58:41 +0000 (14:58 +0200)] 
readtokens: Use the counted_by attribute.

* lib/readtokens.h (struct tokenbuffer): Mark the buffer field as
counted_by size.

10 days agombfile: Add comments regarding the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 12:46:15 +0000 (14:46 +0200)] 
mbfile: Add comments regarding the counted_by attribute.

* lib/mbfile.h (struct mbfile_multi): Clarify how many elements of the
fields buf and pushback are used.

10 days agolinebuffer: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 12:35:18 +0000 (14:35 +0200)] 
linebuffer: Use the counted_by attribute.

* lib/linebuffer.h (struct linebuffer): Mark the buffer field as
counted_by size.

10 days agohash: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 12:27:16 +0000 (14:27 +0200)] 
hash: Use the counted_by attribute.

* lib/hash.c (struct hash_table): Mark the bucket field as counted_by
n_buckets. Swap these fields (needed for clang, see
<https://discourse.llvm.org/t/rfc-forward-referencing-a-struct-member-within-bounds-annotations/85510>).

10 days agolinkedhash-set: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 12:16:26 +0000 (14:16 +0200)] 
linkedhash-set: Use the counted_by attribute.

* lib/gl_linkedhash_set.c (struct gl_set_impl): Mark the table field as
counted_by table_size. Swap these fields (needed for clang).

10 days agohash-set: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 12:15:54 +0000 (14:15 +0200)] 
hash-set: Use the counted_by attribute.

* lib/gl_hash_set.c (struct gl_set_impl): Mark the table field as
counted_by table_size. Swap these fields (needed for clang).

10 days agolinkedhash-map: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 12:14:52 +0000 (14:14 +0200)] 
linkedhash-map: Use the counted_by attribute.

* lib/gl_linkedhash_map.c (struct gl_map_impl): Mark the table field as
counted_by table_size. Swap these fields (needed for clang).

10 days agohash-map: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 12:14:01 +0000 (14:14 +0200)] 
hash-map: Use the counted_by attribute.

* lib/gl_hash_map.c (struct gl_map_impl): Mark the table field as
counted_by table_size. Swap these fields (needed for clang).

10 days agolinkedhash-list: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 12:12:41 +0000 (14:12 +0200)] 
linkedhash-list: Use the counted_by attribute.

* lib/gl_anylinked_list1.h (struct gl_list_impl): Mark the table field
as counted_by table_size. Swap these fields (needed for clang).

10 days agorbtreehash-list: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 12:08:20 +0000 (14:08 +0200)] 
rbtreehash-list: Use the counted_by attribute.

* lib/gl_anyrbtree_list1.h (struct gl_list_impl): Mark the table field
as counted_by table_size. Swap these fields (needed for clang).

10 days agoavltreehash-list: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 12:07:23 +0000 (14:07 +0200)] 
avltreehash-list: Use the counted_by attribute.

* lib/gl_anyavltree_list1.h (struct gl_list_impl): Mark the table field
as counted_by table_size. Swap these fields (needed for clang).

10 days agocarray-list: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 11:58:53 +0000 (13:58 +0200)] 
carray-list: Use the counted_by attribute.

* lib/gl_carray_list.c (struct gl_list_impl): Mark the elements field as
counted_by allocated. Swap these fields (needed for clang).

10 days agoarray-set: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 11:54:51 +0000 (13:54 +0200)] 
array-set: Use the counted_by attribute.

* lib/gl_array_set.c (struct gl_set_impl): Mark the elements field as
counted_by count. Swap these fields (needed for clang).
(gl_array_nx_add): Increase set->count before writing into
set->elements.

10 days agoarray-oset: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 11:53:34 +0000 (13:53 +0200)] 
array-oset: Use the counted_by attribute.

* lib/gl_array_oset.c (struct gl_oset_impl): Mark the elements field as
counted_by count. Swap these fields (needed for clang).
(gl_array_nx_add_at): Increase set->count before writing into
set->elements.

10 days agoarray-omap: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 11:52:05 +0000 (13:52 +0200)] 
array-omap: Use the counted_by attribute.

* lib/gl_array_omap.c (struct gl_omap_impl): Mark the pairs field as
counted_by count. Swap these fields (needed for clang).
(gl_array_nx_add_at): Increase map->count before writing into
map->pairs.

10 days agoarray-map: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 11:50:43 +0000 (13:50 +0200)] 
array-map: Use the counted_by attribute.

* lib/gl_array_map.c (struct gl_map_impl): Mark the pairs field as
counted_by count. Swap these fields (needed for clang).
(gl_array_nx_getput): Increase map->count before writing into
map->pairs.

10 days agoarray-list: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 09:41:31 +0000 (11:41 +0200)] 
array-list: Use the counted_by attribute.

* lib/gl_array_list.c (struct gl_list_impl): Mark the elements field as
counted_by count. Swap these fields (needed for clang).
(gl_array_nx_add_first, gl_array_nx_add_last, gl_array_nx_add_before,
gl_array_nx_add_after, gl_array_nx_add_at): Increase list->count before
writing into list->elements.

10 days agoexclude: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 08:52:33 +0000 (10:52 +0200)] 
exclude: Use the counted_by attribute.

* lib/exclude.c (struct exclude_pattern): Mark the exclude field as
counted_by exclude_count. Swap these fields (needed for clang, see
<https://discourse.llvm.org/t/rfc-forward-referencing-a-struct-member-within-bounds-annotations/85510>).
(new_exclude_segment): Update.
(add_exclude): Increase pat->exclude_count before writing into
pat->exclude.

10 days agodfa: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 08:40:52 +0000 (10:40 +0200)] 
dfa: Use the counted_by attribute.

* lib/dfa.c (struct mb_char_classes): Mark the chars field as counted_by
nchars. Swap these fields (needed for clang, see
<https://discourse.llvm.org/t/rfc-forward-referencing-a-struct-member-within-bounds-annotations/85510>).
(parse_bracket_exp): Increase dfa->lex.brack.nchars before writing into
dfa->lex.brack.chars.

10 days agoargp: Use the counted_by attribute.
Bruno Haible [Sun, 3 May 2026 06:51:08 +0000 (08:51 +0200)] 
argp: Use the counted_by attribute.

* lib/argp-help.c (struct hol): Mark the entries fields as counted_by
num_entries. Swap these fields (needed for clang, see
<https://discourse.llvm.org/t/rfc-forward-referencing-a-struct-member-within-bounds-annotations/85510>).

10 days agodfa: Remove a redundant forward declaration.
Bruno Haible [Sun, 3 May 2026 08:32:35 +0000 (10:32 +0200)] 
dfa: Remove a redundant forward declaration.

* lib/dfa.h: Remove redundant 'struct dfamust' forward declaration.

10 days agocrypto/af_alg: Silence -Wzero-as-null-pointer-constant warning.
Collin Funk [Sat, 2 May 2026 22:55:32 +0000 (15:55 -0700)] 
crypto/af_alg: Silence -Wzero-as-null-pointer-constant warning.

* lib/af_alg.c (alg_socket): Use NULL instead of zero.

11 days agostrtof, strtod, strtold: Return NaNs with correct sign.
Bruno Haible [Sat, 2 May 2026 13:27:52 +0000 (15:27 +0200)] 
strtof, strtod, strtold: Return NaNs with correct sign.

Reported by Mohammad-Reza Nabipoor <mnabipoor@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-04/msg00136.html>.

* m4/strtof.m4 (gl_FUNC_STRTOF): Add test whether strtod works on signed
NaNs.
* m4/strtod.m4 (gl_FUNC_STRTOD): Likewise.
* m4/strtold.m4 (gl_FUNC_STRTOLD): Likewise.
* lib/strtod.c: Include isnan?-nolibm.h.
(HAS_MINUS_NAN_BUG): New macro.
(STRTOD): Add separate implementation for HAS_MINUS_NAN_BUG.
* modules/strtof (Files): Add m4/signbit.m4.
(Depends-on): Add isnanf-nolibm, signbit-no-c++.
* modules/strtod (Files): Add m4/signbit.m4.
(Depends-on): Add isnand-nolibm, signbit-no-c++.
* modules/strtold (Files): Add m4/signbit.m4.
(Depends-on): Add isnanl-nolibm, signbit-no-c++.
* tests/test-strtof.h (test_function): Enable the test of sign bits of
NaN.
* tests/test-strtod.h (test_function): Likewise.
* tests/test-strtold.h (test_function): Likewise.
* doc/posix-functions/strtof.texi: Document the bug regarding "-nan".
* doc/posix-functions/strtod.texi: Likewise.
* doc/posix-functions/strtold.texi: Likewise.

11 days agopthread_sigmask tests: Fix a build failure on NetBSD.
Bruno Haible [Sat, 2 May 2026 11:30:00 +0000 (13:30 +0200)] 
pthread_sigmask tests: Fix a build failure on NetBSD.

* lib/pthread_sigmask.c (pthread_sigmask): Work around a NetBSD bug.

12 days agohamt: Use the counted_by attribute.
Bruno Haible [Fri, 1 May 2026 22:14:10 +0000 (00:14 +0200)] 
hamt: Use the counted_by attribute.

* lib/hamt.c (struct bucket): Mark the elts fields as counted_by
elt_count.

12 days agoattribute: Provide access to clang's counted_by attribute.
Bruno Haible [Fri, 1 May 2026 21:59:06 +0000 (23:59 +0200)] 
attribute: Provide access to clang's counted_by attribute.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Define _GL_ATTRIBUTE_COUNTED_BY.
* lib/attribute.h (COUNTED_BY): New macro.

12 days agoImprove comments about GCC bugs.
Bruno Haible [Fri, 1 May 2026 20:35:13 +0000 (22:35 +0200)] 
Improve comments about GCC bugs.

* m4/nullptr.m4 (gl_NULLPTR): Add info about gcc bug 114780.
* modules/uniname/uniname (Makefile.am): Add info about gcc bug 110112.
* tests/test-intprops.c: Correct info about gcc bug 68971.

12 days agomanywarnings: GCC 16 changes
Paul Eggert [Fri, 1 May 2026 16:03:49 +0000 (09:03 -0700)] 
manywarnings: GCC 16 changes

* build-aux/gcc-warning.spec: Add options introduced in GCC 16.
Remove -Wfree-labels (not limited to objc), -Wuseless-cast
(not limited to c++ and objc++).
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wfree-labels,
-Wkeyword-macro (new to GCC 16), -Wuseless-casts.

12 days agomanywarnings: simplify C warning audits
Paul Eggert [Fri, 1 May 2026 16:02:37 +0000 (09:02 -0700)] 
manywarnings: simplify C warning audits

* build-aux/gcc-warning.spec: Omit many c++, objc, obcj++,
fortran warnings as we no longer need to track them here.
Mark a few of these warnings as now being defaults (for C too).
* m4/manywarnings.m4: In comment that says how to audit this file,
use ‘gcc --help=c,warnings’ and ‘gcc --help=common,warnings’
instead of ‘gcc --help=warnings’, as the latter outputs irrelevant
warnings about c++, objc, obcj++, fortran.

12 days agostdc_rotate_left tests, stdc_rotate_right tests: Fix gcc warning.
Bruno Haible [Fri, 1 May 2026 07:04:07 +0000 (09:04 +0200)] 
stdc_rotate_left tests, stdc_rotate_right tests: Fix gcc warning.

* tests/test-stdc_rotate_left.c (TEST_CASE): Fix "unused variable 'e'"
warning.
* tests/test-stdc_rotate_right.c (TEST_CASE): Likewise.

13 days agogetlocalename_l-simple tests: Avoid test failure on NetBSD.
Bruno Haible [Thu, 30 Apr 2026 20:53:21 +0000 (22:53 +0200)] 
getlocalename_l-simple tests: Avoid test failure on NetBSD.

* tests/test-getlocalename_l.c (FAKE_COLLATE): New macro.
(main): If FAKE_COLLATE is true, don't compare the result of
getlocalename_l (LC_COLLATE, ...).
* doc/posix-functions/getlocalename_l.texi: Mention the NetBSD bug.

13 days agostdbit-h: namespace cleanup port to G++ 15
Paul Eggert [Thu, 30 Apr 2026 00:10:56 +0000 (17:10 -0700)] 
stdbit-h: namespace cleanup port to G++ 15

For the namespace cleanup, don’t assume that the system <stdbit.h>
defines size_t etc. unless it also defines
__STDC_VERSION_STDBIT_H__.  This works around problems with C++
compilers where ‘#include <stdbit.h>’ is a no-op, such as g++ 15.2.1.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-04/msg00203.html
It also lets us simplify the code by removing a special case for
the Intel icpx C++ compiler.
* lib/stdbit.in.h: When deciding whether <stdbit.h> works,
use (defined __STDC_VERSION_STDBIT_H__) rather than @HAVE_STDBIT_H@.
This fixes problems when <stdbit.h> works for C so @HAVE_STDBIT_H@
is 1, whereas <stdbit.h> does nothing for C++.
(__STDC_VERSION_STDBIT_H__): Move definition to end.

2 weeks agostdbit-h: <stddef.h> namespace cleanup
Paul Eggert [Wed, 29 Apr 2026 22:11:50 +0000 (15:11 -0700)] 
stdbit-h: <stddef.h> namespace cleanup

* lib/stdbit.in.h: Include <stddef.h> only if the stdc_memreverse8
module is also used, since it’s the only one that needs size_t.
Define __need_size_t before including <stddef.h>, so that <stddef.h>
defines only size_t on GNU platforms.

2 weeks agostdbit-h: include <stdint.h> only on module req
Paul Eggert [Wed, 29 Apr 2026 20:58:50 +0000 (13:58 -0700)] 
stdbit-h: include <stdint.h> only on module req

This is another attempt to tighten up the <stdbit.h> namespace
on GNU platforms, and follows up on previous C++ fixes here.
* lib/stdbit.in.h: Include <stdint.h> only when also using a
module like stdc_memreverse8 with an API that uses <stdint.h>
types that are not otherwise defined.
This should work better with portable code, as code that merely
wants u?int(_least)?N_t should include <stdint.h>, not <stdbit.h>.
(_GL_STDBIT_UINT_FAST16 _GL_STDBIT_UINT_FAST32)
(_GL_STDBIT_UINT_FAST64): Simplify logic by defining them to the
<stdint.h> equivalents whenever stdint.h is included.

2 weeks agombrtoc32-regular: Strengthen the configure test.
Bruno Haible [Wed, 29 Apr 2026 14:31:30 +0000 (16:31 +0200)] 
mbrtoc32-regular: Strengthen the configure test.

* m4/mbrtoc32-regular.m4: New file.
* modules/mbrtoc32-regular (Files): Add it.
(configure.ac): Invoke gl_FUNC_MBRTOC32_REGULAR.
* m4/mbrtoc32.m4 (gl_FUNC_MBRTOC32): Set gl_cv_func_mbrtoc32_regular.
If it's "no" or "guessing no", set REPLACE_MBRTOC32=1.

2 weeks agoerror-h: Support multiple gnulib-tool invocations in the same package.
Bruno Haible [Tue, 28 Apr 2026 23:52:17 +0000 (01:52 +0200)] 
error-h: Support multiple gnulib-tool invocations in the same package.

* lib/error.in.h (GNULIB_defined_error, GNULIB_defined_error_at_line):
New macros.
(verror): Test GNULIB_defined_verror, for consistency with the idiom.
(verror_at_line): Test GNULIB_defined_verror_at_line, for consistency
with the idiom.

2 weeks agorealloc-posix: Support multiple gnulib-tool invocations in a package.
Bruno Haible [Tue, 28 Apr 2026 23:49:40 +0000 (01:49 +0200)] 
realloc-posix: Support multiple gnulib-tool invocations in a package.

* lib/stdlib.in.h (rpl_realloc): Don't define if _GL_INLINE_RPL_REALLOC
is already defined.

2 weeks agostring-h: Support multiple gnulib-tool invocations in the same package.
Bruno Haible [Tue, 28 Apr 2026 23:47:39 +0000 (01:47 +0200)] 
string-h: Support multiple gnulib-tool invocations in the same package.

* lib/string.in.h (GNULIB_defined_memeq, GNULIB_defined_streq,
GNULIB_defined_strnul): New macros.

2 weeks agostdbit-h: Support multiple gnulib-tool invocations in the same package.
Bruno Haible [Tue, 28 Apr 2026 23:46:06 +0000 (01:46 +0200)] 
stdbit-h: Support multiple gnulib-tool invocations in the same package.

* lib/stdbit.in.h (GNULIB_defined_clz_functions,
GNULIB_defined_stdc_leading_zeros_functions,
GNULIB_defined_stdc_leading_ones_functions,
GNULIB_defined_ctz_functions,
GNULIB_defined_stdc_trailing_zeros_functions,
GNULIB_defined_stdc_trailing_ones_functions,
GNULIB_defined_stdc_first_leading_zero_functions,
GNULIB_defined_stdc_first_leading_one_functions,
GNULIB_defined_stdc_first_trailing_zero_functions,
GNULIB_defined_stdc_first_trailing_one_functions,
GNULIB_defined_popcount_functions,
GNULIB_defined_stdc_count_ones_functions,
GNULIB_defined_stdc_count_zeros_functions,
GNULIB_defined_stdc_has_single_bit_functions,
GNULIB_defined_stdc_bit_width_functions,
GNULIB_defined_stdc_bit_floor_functions,
GNULIB_defined_stdc_bit_ceil_functions,
GNULIB_defined_stdc_rotate_left_functions,
GNULIB_defined_stdc_rotate_right_functions,
GNULIB_defined_stdc_memreverse8,
GNULIB_defined_stdc_memreverse8u_functions,
GNULIB_defined_stdc_load8_functions,
GNULIB_defined_stdc_load8_aligned_functions,
GNULIB_defined_stdc_store8_functions,
GNULIB_defined_stdc_store8_aligned_functions): New macros.

2 weeks agoendian: Support multiple gnulib-tool invocations in the same package.
Bruno Haible [Tue, 28 Apr 2026 23:40:18 +0000 (01:40 +0200)] 
endian: Support multiple gnulib-tool invocations in the same package.

* lib/endian.in.h (GNULIB_defined_be16toh, GNULIB_defined_be32toh,
GNULIB_defined_be64toh, GNULIB_defined_htobe16, GNULIB_defined_htobe32,
GNULIB_defined_htobe64, GNULIB_defined_le16toh, GNULIB_defined_le32toh,
GNULIB_defined_le64toh, GNULIB_defined_htole16, GNULIB_defined_htole32,
GNULIB_defined_htole64): New macros.

2 weeks agoarpa_inet-h: Support multiple gnulib-tool invocations in a package.
Bruno Haible [Tue, 28 Apr 2026 23:37:37 +0000 (01:37 +0200)] 
arpa_inet-h: Support multiple gnulib-tool invocations in a package.

* lib/arpa_inet.in.h (GNULIB_defined_htons, GNULIB_defined_htonl,
GNULIB_defined_ntohs, GNULIB_defined_ntohl): New macros.

2 weeks agostdbit-h: Fix syntax error in C++ mode.
Bruno Haible [Tue, 28 Apr 2026 23:19:10 +0000 (01:19 +0200)] 
stdbit-h: Fix syntax error in C++ mode.

* lib/stdbit.in.h (__STDC_ENDIAN_*): Define also in C++ mode.

2 weeks agostdbit-h: Fix syntax errors in C++ mode (regression 2026-03-16).
Bruno Haible [Tue, 28 Apr 2026 23:23:23 +0000 (01:23 +0200)] 
stdbit-h: Fix syntax errors in C++ mode (regression 2026-03-16).

* lib/stdbit.in.h: Include <stddef.h> also for the stdc_memreverse8
module. Include <stdint.h> also when HAVE_STDBIT_H is 1 and
__UINT_FAST64_TYPE__ is defined and some module needs it.

2 weeks agouchar-h: Support multiple gnulib-tool invocations in the same package.
Bruno Haible [Tue, 28 Apr 2026 15:45:52 +0000 (17:45 +0200)] 
uchar-h: Support multiple gnulib-tool invocations in the same package.

* lib/uchar.in.h (GNULIB_defined_btoc32, GNULIB_defined_c32isalnum,
GNULIB_defined_c32isalpha, GNULIB_defined_c32isblank,
GNULIB_defined_c32iscntrl, GNULIB_defined_c32isdigit,
GNULIB_defined_c32isgraph, GNULIB_defined_c32islower,
GNULIB_defined_c32isprint, GNULIB_defined_c32ispunct,
GNULIB_defined_c32isspace, GNULIB_defined_c32isupper,
GNULIB_defined_c32isxdigit, GNULIB_defined_c32tolower,
GNULIB_defined_c32toupper, GNULIB_defined_c32width,
GNULIB_defined_c32snrtombs, GNULIB_defined_c32srtombs,
GNULIB_defined_c32stombs, GNULIB_defined_c32swidth,
GNULIB_defined_c32tob, GNULIB_defined_mbsnrtoc32s,
GNULIB_defined_mbsrtoc32s, GNULIB_defined_mbstoc32s,
GNULIB_defined_c32_get_type_test, GNULIB_defined_c32_apply_type_test,
GNULIB_defined_c32_get_mapping, GNULIB_defined_c32_apply_mapping): New
macros.

2 weeks agoregex: pacify gcc -Wint-in-bool-context
Paul Eggert [Tue, 28 Apr 2026 15:19:08 +0000 (08:19 -0700)] 
regex: pacify gcc -Wint-in-bool-context

* lib/regex_internal.h (re_malloc): Rewrite so that callers
don’t do the equivalent of !(2 * n), which elicits the warning.

2 weeks agoautoupdate
Karl Berry [Tue, 28 Apr 2026 15:07:25 +0000 (08:07 -0700)] 
autoupdate

2 weeks agowindows-cygpath: Handle UNC file names on Cygwin correctly.
Bruno Haible [Tue, 28 Apr 2026 14:49:45 +0000 (16:49 +0200)] 
windows-cygpath: Handle UNC file names on Cygwin correctly.

Reported and initial patch by Vaclav Slavik <vaclav@slavik.io> in
<https://savannah.gnu.org/bugs/?68291>.

* lib/windows-cygpath.c (windows_cygpath_w): Treat file names that start
with '//' like absolute native Windows file names.

2 weeks agoidx: Remove redundant #include.
Bruno Haible [Tue, 28 Apr 2026 09:23:21 +0000 (11:23 +0200)] 
idx: Remove redundant #include.

* lib/idx.h: Drop the second #include <stddef.h>.

2 weeks agoc-strtod tests: Improve last patch.
Bruno Haible [Tue, 28 Apr 2026 09:06:24 +0000 (11:06 +0200)] 
c-strtod tests: Improve last patch.

* tests/test-c-strtof-mt.c: Revert addition of dead code.
* tests/test-c-strtod-mt.c: Likewise.
* tests/test-c-strtold-mt.c: Likewise.
* tests/test-c-strtof-mt.sh: Don't assume that if one invocation of the
test program has exit code 77, the other invocation will have exit code
77 as well.
* tests/test-c-strtod-mt.sh: Likewise.
* tests/test-c-strtold-mt.sh: Likewise.

2 weeks agothread: Fix possible link error (regression 2026-04-25).
Bruno Haible [Tue, 28 Apr 2026 08:20:06 +0000 (10:20 +0200)] 
thread: Fix possible link error (regression 2026-04-25).

* lib/glthread/thread.c (gl_thread_create): Define always. Ignore
-Wsuggest-attribute=noreturn warning.

2 weeks agothread: Improve no-op macros.
Bruno Haible [Tue, 28 Apr 2026 06:11:49 +0000 (08:11 +0200)] 
thread: Improve no-op macros.

* lib/glthread/thread.h (glthread_atfork, glthread_create,
glthread_sigmask, glthread_join): Improve indentation.
(gl_thread_exit): Simplify.

2 weeks agodfa: fix lib/localeinfo.c char32_t comments
Paul Eggert [Tue, 28 Apr 2026 06:16:03 +0000 (23:16 -0700)] 
dfa: fix lib/localeinfo.c char32_t comments

2 weeks agoregex: port to non-GNU malloc
Paul Eggert [Mon, 27 Apr 2026 21:55:39 +0000 (14:55 -0700)] 
regex: port to non-GNU malloc

This is for Gawk, which does not use malloc-gnu.
* lib/regex.c (_GL_USE_STDLIB_ALLOC) [!_LIBC]:
Define, since this module is now safe for AIX-like malloc.
* lib/regex_internal.h (re_malloc) [!_LIBC && !HAVE_MALLOC_0_NONNULL]:
Don’t pass 0 to malloc.

2 weeks agoregex: SSIZE_MAX porting
Paul Eggert [Mon, 27 Apr 2026 21:15:40 +0000 (14:15 -0700)] 
regex: SSIZE_MAX porting

* lib/regex_internal.h (IDX_MAX) [_REGEX_LARGE_OFFSETS]:
Port to non-POSIX platforms where limits.h does not define SSIZE_MAX.
This is for Gawk, which does not use Gnulib limits.h.

2 weeks agoidx: cleaner namespace on GNU
Paul Eggert [Mon, 27 Apr 2026 20:05:32 +0000 (13:05 -0700)] 
idx: cleaner namespace on GNU

* lib/idx.h: Include <stddef.h>, <stdint.h> only if needed.
(idx_t, IDX_MAX): Rely on builtin macros __PTRDIFF_TYPE__,
__PTRDIFF_MAX__ if present; this avoids polluting the namespace on
GNUish systems.

2 weeks agoautoupdate
Karl Berry [Mon, 27 Apr 2026 15:00:44 +0000 (08:00 -0700)] 
autoupdate

2 weeks agolocalename-unsafe: respect --disable-threads
Paul Eggert [Sun, 26 Apr 2026 22:09:00 +0000 (15:09 -0700)] 
localename-unsafe: respect --disable-threads

Respect --disable-threads on native MS-Windows.
* lib/localename-unsafe.c (GLWTHREAD_MUTEX_INIT, glwthread_mutex_t)
(glwthread_mutex_lock, glwthread_mutex_unlock)
[AVOID_ANY_THREADS && _WIN32 && !__CYGWIN]:
Instead of including "windows-mutex.h", provide no-op substitutes
for its symbols used here.

2 weeks agoautoupdate
Karl Berry [Sun, 26 Apr 2026 14:51:44 +0000 (07:51 -0700)] 
autoupdate

2 weeks agoc-strtod-tests: port to single-threaded builds
Paul Eggert [Sat, 25 Apr 2026 22:25:09 +0000 (15:25 -0700)] 
c-strtod-tests: port to single-threaded builds

* tests/test-c-strtod-mt.c:
* tests/test-c-strtof-mt.c:
* tests/test-c-strtold-mt.c:
(main): The tests make no sense when single-threaded, so skip them
by exiting with status 77.
* tests/test-c-strtod-mt.sh:
* tests/test-c-strtof-mt.sh:
* tests/test-c-strtold-mt.sh:
Exit with the failing test’s status, so that if it exits with
status 77 then we do too.

2 weeks agocond: always include glthread/lock.h
Paul Eggert [Sat, 25 Apr 2026 22:19:27 +0000 (15:19 -0700)] 
cond: always include glthread/lock.h

* lib/glthread/cond.h: Revert my 2026-03-31 namespace cleanup
patch, which was incorrect because this header’s
gl_cond_timedwait_func function uses lock_t even when threading is
disabled.

2 weeks agothread: better nonreturn fix for gl_thread_create
Paul Eggert [Sat, 25 Apr 2026 22:15:48 +0000 (15:15 -0700)] 
thread: better nonreturn fix for gl_thread_create

* lib/glthread/thread.c (gl_thread_create):
Define as a function only if multithreading.
This is cleaner than my previous patch today that sometimes made
it _Noreturn, as the function’s definition and declaration now always
agree on noreturnedness, and it pushes the noreturnedness issue up
to the caller.  Also, it suppresses GCC’s “warning: function
declared 'noreturn' has a 'return' statement”.

2 weeks agothread: pacify gcc -Wunused-value
Paul Eggert [Sat, 25 Apr 2026 16:40:41 +0000 (09:40 -0700)] 
thread: pacify gcc -Wunused-value

* lib/glthread/thread.h (glthread_atfork, glthread_sigmask)
(glthread_create, glthread_join): Evaluate arguments even when
these macros are no-ops.  Type-check the arguments too.  This is
cleaner anyway, in case the args have the wrong types (or have
side effects!).

2 weeks agothread: pacify gcc -Wsuggest-attribute=noreturn
Paul Eggert [Sat, 25 Apr 2026 16:40:41 +0000 (09:40 -0700)] 
thread: pacify gcc -Wsuggest-attribute=noreturn

* lib/glthread/thread.c (gl_thread_create):
When threading is disabled, this function is _Noreturn.

2 weeks agoregex: Remove misplaced comment.
Bruno Haible [Sat, 25 Apr 2026 09:41:27 +0000 (11:41 +0200)] 
regex: Remove misplaced comment.

* modules/regex (Depends-on): Don't mention uchar-h-c23.

2 weeks agoxstrtol tests: Don't rely on is_GNULIB_strtol.
Bruno Haible [Sat, 25 Apr 2026 16:15:46 +0000 (18:15 +0200)] 
xstrtol tests: Don't rely on is_GNULIB_strtol.

In a testdir, the Gnulib replacement for strtol may be used in gltests/
but not in gllib/.

* tests/test-xstrtol.c (is_GNULIB_strtol): Remove macro.
(main): Accept both behaviours of strtol on all platforms except MSVC.
* tests/test-xstrtoll.c (is_GNULIB_strtol): Remove macro.

2 weeks agoregex: Fix link error on macOS and FreeBSD (regression yesterday).
Bruno Haible [Sat, 25 Apr 2026 09:26:37 +0000 (11:26 +0200)] 
regex: Fix link error on macOS and FreeBSD (regression yesterday).

* modules/regex (Link): Add $(LIBUNISTRING), $(LIBC32CONV).
* modules/regex-tests (Makefile.am): Link test-regex with
$(LIBUNISTRING) and $(LIBC32CONV).

2 weeks agouchar-h tests: Strengthen tests.
Bruno Haible [Sat, 25 Apr 2026 08:09:58 +0000 (10:09 +0200)] 
uchar-h tests: Strengthen tests.

* tests/test-uchar-h.c: Move #include <wchar.h> after most other tests
are done.

2 weeks agoregex: be consistent with dfa
Paul Eggert [Sat, 25 Apr 2026 00:28:58 +0000 (17:28 -0700)] 
regex: be consistent with dfa

In the regex code, use the char32_t functions instead of the
wchar_t functions, so that regex stays in sync with dfa.
This should fix a bug in Gnu grep reported by Dennis Clarke for
OpenBSD <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=80774#47>.
A similar bug occurs in some macOS releases.
* modules/regex (Depends-on): Replace btowc, iswctype, mbrtowc,
wchar-h, wcrtomb, wctype-h, and wctype with btoc32,
c32_apply_type_test, c32_get_type_test, c32isalnum, c32rtomb,
c32tolower, c32toupper, mbrtoc32-regular, uchar-h.
* lib/regex_internal.h [!_LIBC]: Do not include <wchar.h>, <wctype.h>.
Instead, include <uchar.h> and #define wchar_t, wctype_t,
__wctype, __iswalnum, __iswctype, __towlower, __towupper, __btowc,
__mbrtowc, and __wcrtomb to their char32_t counterparts.

2 weeks agodfa: always use char32_t not wchar_t
Paul Eggert [Sat, 25 Apr 2026 00:14:22 +0000 (17:14 -0700)] 
dfa: always use char32_t not wchar_t

This should help merges changes from Gawk, which always uses the
char32_t API though that’s sometimes implemented with the wchar_t
API even on platforms where wchar_t and char32_t act differently.
The idea is to use char32_t uniformly in both the dfa and regex
modules, so that they get consistent answers on all platforms.
* lib/dfa.c, lib/localeinfo.c, lib/localeinfo.h: If GAWK, do not
include <wctype.h> or redefine the Gnulib char32_t types and
functions to be wchar.h and wctype.h functions or define mbszero
and streq, as I think I have a better way to do this with Gawk
that is less intrusive here; instead, always include <uchar.h>.
* lib/dfa.c: Do not include <wchar.h>.  Include "getext.h" before
including "xalloc.h" and "localinfo.h", as Gnulib doesn’t care
about the order and this works better with Gawk’s way of overriding Gnulib.
(parse_bracket_exp): Use && instead of &; either is correct and
both are equally fast nowadays but && triggers a warning in some
Gawk compiles.
* lib/dfa.h (_GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_DEALLOC)
(_GL_ATTRIBUTE_DEALLOC_FREE)
(_GL_ATTRIBUTE_RETURNS_NONNULL) [!_GL_ATTRIBUTE_MALLOC]:
Remove, as Gawk’s custom.h can define them.
* lib/localeinfo.c: Go back to using <verify.h> and ‘verify’
instead of using static_assert which Gawk can’t easily use because
it does not use Gnulib’s assert-h module.
* lib/localeinfo.h: Do not include <limits.h>, avoding some
namespace pollution.
(struct localeinfo): Use (unsigned char) -1 instead of UCHAR_MAX
to avoid the need to include <limits.h>.
* modules/dfa (Depends-on): Remove wchar-h.

2 weeks agouchar-h: <string.h> etc. namespace cleanup
Paul Eggert [Fri, 24 Apr 2026 23:00:34 +0000 (16:00 -0700)] 
uchar-h: <string.h> etc. namespace cleanup

This is only a partial cleanup; to be cleaner we’d need to
move declarations of Gnulib extensions like c32isalpha
into a separate .h file.  However, if no Gnulib modules that
extend <uchar.h> are used, Gnulib <uchar.h> is now pretty clean on
recent GNUish platforms.
* lib/uchar.in.h: On GNUish platforms, include <stdint.h>,
<wchar.h>, <wctype.h> only if needed.  Do not include <string.h>,
as we never need it directly: even if we use <string.h>’s memset
via mbszero, <wchar.h> should include <string.h> if needed, as
<wchar.h> defines mbszero.  Move a static_assert from here to tests,
as the static_assert uses a symbol that is no longer guaranteed
to be visible.
* modules/uchar-h (Depends-on): Do not depend on assert-h.
* tests/test-uchar-h.c: Move a static_assert here from lib/uchar.in.h,
and include <wchar.h> so that wchar_t is guaranteed to be visible.

2 weeks agodoc: document namespace pollution allowed by POSIX
Paul Eggert [Fri, 24 Apr 2026 21:09:31 +0000 (14:09 -0700)] 
doc: document namespace pollution allowed by POSIX

In the manual, document where POSIX.1-2024 allows namespace pollution.
Although it might be nice to add something like GNULIB_POSIXCHECK to
detect when Gnulib-using code is unportable in this area, I don’t
offhand see a good way to do that.

2 weeks agoversion-etc: Optionally emit another line for the man page.
Bruno Haible [Fri, 24 Apr 2026 13:31:00 +0000 (15:31 +0200)] 
version-etc: Optionally emit another line for the man page.

* lib/version-etc.c: Include <stdlib.h>.
(emit_bug_reporting_address): Terminate the "Report bugs to" sentence,
as suggested in
https://www.gnu.org/software/gettext/manual/html_node/Bug-Report-Address.html.
Add a "Report any translation bugs to" sentence, but only when producing
a man page.

2 weeks agobcp47: Fix handling of variants of length 4.
Bruno Haible [Fri, 24 Apr 2026 13:57:52 +0000 (15:57 +0200)] 
bcp47: Fix handling of variants of length 4.

Reported by Patrice Dumas <pertusus@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-04/msg00154.html>.

* lib/bcp47.c (bcp47_to_xpg): Don't parse a variant of length 4 that
contains some digits as a script.
* tests/test-bcp47.c (main): Add a test case with a variant of length 4.

2 weeks agowchar-h: <string.h> namespace cleanup
Paul Eggert [Thu, 23 Apr 2026 19:59:52 +0000 (12:59 -0700)] 
wchar-h: <string.h> namespace cleanup

Do not pollute <wchar.h> includers with <string.h> names
on GCC-compatible platforms.
* lib/wchar.in.h (_GL_WCHAR_MEMSET) [@GNULIB_MBSZERO@]: New macro.
(mbszero): Use it.

3 weeks agoautoupdate
Karl Berry [Mon, 20 Apr 2026 14:27:13 +0000 (07:27 -0700)] 
autoupdate

3 weeks agoautoupdate
Karl Berry [Mon, 20 Apr 2026 14:22:45 +0000 (07:22 -0700)] 
autoupdate

3 weeks agomaint.mk: fix sc_Wundef_boolean race with parallel syntax-check
Jim Meyering [Mon, 20 Apr 2026 02:36:03 +0000 (19:36 -0700)] 
maint.mk: fix sc_Wundef_boolean race with parallel syntax-check

With highly parallel "make syntax-check", sc_Wundef_boolean's
in_files='config.h' was matched as an unanchored, unescaped regex
by "find | grep -E", so the '.' matched any character and the lack
of anchoring matched anywhere in a path.  This made it match the
.sc-start-sc_*config_h* marker files created by parallel rules.
Symptom: I saw see these go by:
  grep: ./.sc-start-sc_require_config_h_first: No such file or directory
  grep: ./.sc-start-sc_prohibit_have_config_h: No such file or directory
  grep: ./.sc-start-sc_require_config_h: No such file or directory
* top/maint.mk (sc_Wundef_boolean): Use '(^|/)config\.h$' rather
than bare 'config.h' as the in_files ERE.

3 weeks agoregex tests: pacify -Wshadow
Paul Eggert [Sun, 19 Apr 2026 18:21:49 +0000 (11:21 -0700)] 
regex tests: pacify -Wshadow

* tests/test-regex.c (main):
Rename a local to avoid shadowing confusion.

3 weeks agoreadutmp: greeters are not users
Paul Eggert [Sun, 19 Apr 2026 18:12:16 +0000 (11:12 -0700)] 
readutmp: greeters are not users

* lib/readutmp.c (read_utmp_from_systemd):
Do not merely treat a "manager*" class as a login process.
Instead, treat all non-"user*" processes as login processes.
With current systemd, this changes the treatment of "greeter",
"lock-screen", "background", "background-light", and "none"
classes so that they are now considered to be login processes, not
user processes.

3 weeks agoregex: avoid a UBSAN failure: remove an unnecessary DEBUG_ASSERT
Jim Meyering [Sun, 19 Apr 2026 16:52:26 +0000 (09:52 -0700)] 
regex: avoid a UBSAN failure: remove an unnecessary DEBUG_ASSERT

* lib/regex_internal.c (re_node_set_insert): Remove the DEBUG_ASSERT
and instead return early for an attempt to insert an ELEM that is
already present in the set.  Relax the function's comment that says
there should be no duplicate.  This function is called from many
places and has been working fine.  With its nontrivial backrefs,
the sample regexp apparently elicits enough backtracking retries
and state-set merges to trigger this duplicate insertion attempt.
Reported by Bruno Haible in
https://lists.gnu.org/r/bug-gnulib/2026-04/msg00138.html

3 weeks agoregex tests: Add a test case that triggers an assertion failure.
Bruno Haible [Sun, 19 Apr 2026 13:18:55 +0000 (15:18 +0200)] 
regex tests: Add a test case that triggers an assertion failure.

* tests/test-regex.c (main): Add a test case related to back references.

3 weeks agoreadutmp: Silence -Wzero-as-null-pointer-constant warning.
Collin Funk [Sun, 19 Apr 2026 02:42:21 +0000 (19:42 -0700)] 
readutmp: Silence -Wzero-as-null-pointer-constant warning.

* lib/readutmp.c (read_utmp_from_systemd): Initialize all of the struct
members and use NULL for the pointer.

3 weeks agodoc: doc FTS_NOSTAT with FIFO, not directory
Paul Eggert [Fri, 17 Apr 2026 16:14:49 +0000 (09:14 -0700)] 
doc: doc FTS_NOSTAT with FIFO, not directory

* lib/fts.in.h (FTS_NOSTAT): Use a FIFO, not a directory,
in the commentary’s example.  This is a better example
because directories never have FTS_NSOK.

3 weeks agoregex: Silence -Wzero-as-null-pointer-constant warning.
Collin Funk [Fri, 17 Apr 2026 04:50:27 +0000 (21:50 -0700)] 
regex: Silence -Wzero-as-null-pointer-constant warning.

* lib/regexec.c (merge_state_with_log): Check the pointer against NULL.

3 weeks agobyteswap: Fix compilation on Solaris OpenIndiana (regr. 2026-03-20).
Bruno Haible [Thu, 16 Apr 2026 16:49:36 +0000 (18:49 +0200)] 
byteswap: Fix compilation on Solaris OpenIndiana (regr. 2026-03-20).

* lib/byteswap.in.h: Include <stdint.h>.
* modules/byteswap (Depends-on): Add stdint-h.

3 weeks agosigdelay: Don't use out-of-range signal numbers.
Bruno Haible [Thu, 16 Apr 2026 12:15:52 +0000 (14:15 +0200)] 
sigdelay: Don't use out-of-range signal numbers.

* lib/sigdelay.c (states): Change number of elements to NSIG.

3 weeks agosigdelay, posix-spawn-internal: Ignore out-of-range signal numbers.
Bruno Haible [Thu, 16 Apr 2026 12:14:38 +0000 (14:14 +0200)] 
sigdelay, posix-spawn-internal: Ignore out-of-range signal numbers.

* lib/sigdelay.c (sigdelay): Do nothing when sigismember() returns -1.
* lib/spawni.c (__spawni): Likewise.

3 weeks agosigprocmask: Fix sigismember function.
Bruno Haible [Thu, 16 Apr 2026 11:03:39 +0000 (13:03 +0200)] 
sigprocmask: Fix sigismember function.

* lib/sigprocmask.c (sigismember): If the signal argument is invalid,
return -1 instead of 0.

4 weeks agopthread_sigmask tests: Fix test failure on Solaris, AIX (regr. today).
Bruno Haible [Wed, 15 Apr 2026 22:28:43 +0000 (00:28 +0200)] 
pthread_sigmask tests: Fix test failure on Solaris, AIX (regr. today).

Reported by Pádraig Brady.

* tests/test-pthread_sigmask2.c (main): Reestablish the signal handler
after SIGINT arrived.
* tests/test-sigdelay2.c (main): Likewise.

4 weeks agodoc: doc FTS_NOSTAT similarity to FTS_DEFER_STAT
Paul Eggert [Wed, 15 Apr 2026 21:47:55 +0000 (14:47 -0700)] 
doc: doc FTS_NOSTAT similarity to FTS_DEFER_STAT

* lib/fts.in.h (FTS_NOSTAT, FTS_DEFER_STAT):
Document that FTS_NOSTAT updates fts_statp->st_mode
similarly with FTS_DEFER_STAT.

4 weeks agofts: match doc for FTS_DEFER_STAT mode
Paul Eggert [Wed, 15 Apr 2026 21:45:53 +0000 (14:45 -0700)] 
fts: match doc for FTS_DEFER_STAT mode

* lib/fts.c (fts_open): Clear fts_statp->fts_mode for the
FTS_DEFER_STAT case too, since it’s documented to work since 2008.

4 weeks agosigdelay: Add tests.
Bruno Haible [Wed, 15 Apr 2026 11:45:58 +0000 (13:45 +0200)] 
sigdelay: Add tests.

* tests/test-sigdelay1.c: New file, based on
tests/test-pthread_sigmask1.c.
* tests/test-sigdelay2.c: New file, based on
tests/test-pthread_sigmask2.c.
* modules/sigdelay-tests: New file.

4 weeks agosigdelay: New module.
Bruno Haible [Wed, 15 Apr 2026 11:45:52 +0000 (13:45 +0200)] 
sigdelay: New module.

* lib/sigdelay.h: New file.
* lib/sigdelay.c: New file.
* modules/sigdelay: New file.

4 weeks agopthread_sigmask tests: Enhance test.
Bruno Haible [Wed, 15 Apr 2026 11:45:44 +0000 (13:45 +0200)] 
pthread_sigmask tests: Enhance test.

* tests/test-pthread_sigmask2.c (killer_thread1): Renamed from
killer_thread.
(killer_thread2): New variable.
(killer_thread1_func): Renamed from killer_thread_func.
(killer_thread2_func): New function.
(main): Add a second test with killer_thread2.

4 weeks agopthread_sigmask tests: More details about VirtualBox / KVM bug.
Bruno Haible [Wed, 15 Apr 2026 11:45:35 +0000 (13:45 +0200)] 
pthread_sigmask tests: More details about VirtualBox / KVM bug.

* tests/test-pthread_sigmask1.c (main): Refine comment regarding
VirtualBox / KVM bug.
* tests/test-pthread_sigmask2.c (main): Likewise.

4 weeks agosigprocmask: On mingw, avoid dependency on libwinpthread.
Bruno Haible [Tue, 14 Apr 2026 19:56:00 +0000 (21:56 +0200)] 
sigprocmask: On mingw, avoid dependency on libwinpthread.

* lib/sigprocmask.c: Include windows-tls.h, windows-once.h.
(thread_local): Remove macro.
(struct per_thread): New type.
(tls_key): New variable.
(keys_init): New function.
(keys_init_once): New variable.
(get_per_thread): New function.
(per_thread_singleton): New variable.
(blocked_set, pending_array): Remove variables.
(sigpending, override_handler, pthread_sigmask, _gl_raise_SIGPIPE):
Invoke get_per_thread, to access blocked_set or pending_array.
* modules/sigprocmask (Depends-on): Add windows-once, windows-tls.

4 weeks agosigaction: Fix test failure on native Windows.
Bruno Haible [Tue, 14 Apr 2026 18:38:39 +0000 (20:38 +0200)] 
sigaction: Fix test failure on native Windows.

* lib/sigaction.c (sigaction): Hide the sigaction_handler from the
caller.

4 weeks agoerror_h: fix icx version in commentary
Paul Eggert [Tue, 14 Apr 2026 02:19:09 +0000 (19:19 -0700)] 
error_h: fix icx version in commentary

4 weeks agostdbit-h: Port to Intel icpx C++ compiler.
Bruno Haible [Mon, 13 Apr 2026 21:44:24 +0000 (23:44 +0200)] 
stdbit-h: Port to Intel icpx C++ compiler.

* lib/stdbit.in.h: With the Intel icpx C++ compiler, include <stddef.h>
and <stdint.h>, and define the __STDC_ENDIAN_* macros.
* doc/posix-headers/stdbit.texi: Document the Intel icpx bug.

4 weeks agoerror-h: port to Intel OneAPI icx 2026.0.0
Paul Eggert [Mon, 13 Apr 2026 21:01:36 +0000 (14:01 -0700)] 
error-h: port to Intel OneAPI icx 2026.0.0

Problem reported by Harmen Stoppels in:
https://lists.gnu.org/r/bug-gnulib/2026-04/msg00085.html
* m4/error_h.m4 (gl_ERROR_H): Plant an alarm in case error infloops.