]> git.ipfire.org Git - thirdparty/gnulib.git/log
thirdparty/gnulib.git
8 weeks agoDon't use 'typeof' built-in with -std=c99 or -std=c11.
Bruno Haible [Tue, 3 Mar 2026 10:33:11 +0000 (11:33 +0100)] 
Don't use 'typeof' built-in with -std=c99 or -std=c11.

Reported by Alexander Sosedkin <asosedkin@redhat.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-03/msg00019.html>.

* lib/stdcountof.in.h (_gl_verify_is_array): Don't use the definition
with typeof in strict C99 or C11 modes.
* lib/string-desc.h (HAVE_TYPEOF): Don't define in strict C99 or C11
modes.

8 weeks agomanywarnings: Eliminate some never-useful clang warnings.
Bruno Haible [Tue, 3 Mar 2026 07:52:34 +0000 (08:52 +0100)] 
manywarnings: Eliminate some never-useful clang warnings.

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)): Disable the
-Wgnu-include-next, -Wstring-plus-int, -Wstring-plus-char warnings.

8 weeks agoUse countof, part 2.
Bruno Haible [Mon, 2 Mar 2026 13:35:26 +0000 (14:35 +0100)] 
Use countof, part 2.

Done through  sed -e 's/SIZEOF \([(][^()]*[)]\)/countof \1/g'

* lib/boot-time.c: Include <stdcountof.h>.
* lib/readutmp.c: Include <stdcountof.h>.
* lib/boot-time-aux.h (get_linux_boot_time_fallback,
get_openbsd_boot_time, get_windows_boot_time): Use countof.
* lib/duplocale.c: Include <stdcountof.h>.
(SIZEOF): Remove macro.
(duplocale): Use countof instead.
* lib/fatal-signal.c: Include <stdcountof.h>.
(SIZEOF): Remove macro.
(num_fatal_signals, actions_allocated): Use countof instead.
* lib/iconv_open.c: Include <stdcountof.h>.
(SIZEOF): Remove macro.
(rpl_iconv_open): Use countof instead.
* lib/term-style-control.c: Include <stdcountof.h>.
(SIZEOF): Remove macro.
(num_job_control_signals): Use countof instead.
* lib/uniconv/u16-conv-to-enc.c: Include <stdcountof.h>.
(SIZEOF): Remove macro.
* lib/uniconv/u32-conv-to-enc.c: Include <stdcountof.h>.
(SIZEOF): Remove macro.
* lib/uniconv/u-conv-to-enc.h (FUNC): Use countof instead.
* lib/uniconv/u16-strconv-to-enc.c: Include <stdcountof.h>.
(SIZEOF): Remove macro.
* lib/uniconv/u32-strconv-to-enc.c: Include <stdcountof.h>.
(SIZEOF): Remove macro.
* lib/uniconv/u-strconv-to-enc.h (FUNC): Use countof instead.
* lib/uniname/uniname.c: Include <stdcountof.h>.
(SIZEOF): Remove macro.
(unicode_name_word, unicode_name_word_lookup, unicode_code_to_index,
unicode_index_to_code, unicode_character_name, unicode_name_character):
Use countof instead.
* lib/uniwidth/width.c: Include <stdcountof.h>.
(SIZEOF): Remove macro.
(uc_width): Use countof instead.
* lib/wait-process.c: Include <stdcountof.h>.
(SIZEOF): Remove macro.
(slaves_allocated): Use countof instead.
* lib/gen-uni-tables.c (countof): Renamed from SIZEOF.
* modules/boot-time (Depends-on): Add stdcountof-h.
* modules/readutmp (Depends-on): Likewise.
* modules/duplocale (Depends-on): Likewise.
* modules/fatal-signal (Depends-on): Likewise.
* modules/iconv_open (Depends-on): Likewise.
* modules/term-style-control (Depends-on): Likewise.
* modules/uniconv/u16-conv-to-enc (Depends-on): Likewise.
* modules/uniconv/u32-conv-to-enc (Depends-on): Likewise.
* modules/uniconv/u16-strconv-to-enc (Depends-on): Likewise.
* modules/uniconv/u32-strconv-to-enc (Depends-on): Likewise.
* modules/uniname/uniname (Depends-on): Likewise.
* modules/uniwidth/width (Depends-on): Likewise.
* modules/wait-process (Depends-on): Likewise.
* tests/macros.h (SIZEOF): Remove macro.
* tests/**/*.[hc]: Use countof instead of SIZEOF. Include <stdcountof.h>
as needed.
* modules/**/*-tests (Depends-on): Add stdcountof-h if needed.

8 weeks agoUse countof, part 1.
Bruno Haible [Mon, 2 Mar 2026 10:04:16 +0000 (11:04 +0100)] 
Use countof, part 1.

* lib/argmatch.h: Include <stdcountof.h>.
(ARRAY_CARDINALITY): Remove macro.
(ARGMATCH_VERIFY): Use countof instead.
* tests/test-argv-iter.c: Include <stdcountof.h>.
(ARRAY_CARDINALITY): Remove macro.
(main): Use countof instead.
* tests/test-hash.c: Include <stdcountof.h>.
(ARRAY_CARDINALITY): Remove macro.
(main): Use countof instead.
* tests/test-userspec.c: Include <stdcountof.h>.
(ARRAY_CARDINALITY): Remove macro.
(main): Use countof instead.
* modules/argmatch (Depends-on): Add stdcountof-h.
* modules/argv-iter-tests (Depends-on): Likewise.
* modules/hash-tests (Depends-on): Likewise.
* modules/userspec-tests (Depends-on): Likewise.

8 weeks agostdcountof-h: Improve comment.
Bruno Haible [Mon, 2 Mar 2026 12:00:03 +0000 (13:00 +0100)] 
stdcountof-h: Improve comment.

* lib/stdcountof.in.h (countof): Improve comment.

8 weeks agoSilence clang's -Wstring-plus-int warnings in Gnulib code.
Bruno Haible [Mon, 2 Mar 2026 04:29:20 +0000 (05:29 +0100)] 
Silence clang's -Wstring-plus-int warnings in Gnulib code.

* m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): Add -Wno-string-plus-int.

8 weeks agotests: Use streq, part 5.
Bruno Haible [Mon, 2 Mar 2026 08:59:03 +0000 (09:59 +0100)] 
tests: Use streq, part 5.

* tests/test-execute-child.c: Revert last change.
* modules/execute-tests (Depends-on): Remove streq.

8 weeks agostdcountof-h tests: Avoid a clang warning.
Bruno Haible [Sun, 1 Mar 2026 18:55:55 +0000 (19:55 +0100)] 
stdcountof-h tests: Avoid a clang warning.

* tests/test-stdcountof-h.c (call_count, do_call): Don't define in C++
mode.

8 weeks agofloat-h: Ensure ISO C23 compliance with clang 22.
Bruno Haible [Sun, 1 Mar 2026 18:28:29 +0000 (19:28 +0100)] 
float-h: Ensure ISO C23 compliance with clang 22.

* m4/float_h.m4 (gl_FLOAT_H): Test also whether the provided <float.h>
defines {FLT,DBL,LDBL}_IS_IEC_60559.

8 weeks agostrftime: pacify clang -Wstring-plus-int
Paul Eggert [Sun, 1 Mar 2026 18:13:48 +0000 (10:13 -0800)] 
strftime: pacify clang -Wstring-plus-int

This pacifies a warning from default clang 21, and saves a byte.
Problem reported by Badli Al Rashid <https://bugs.gnu.org/80514>.
* lib/strftime.c (c_ampm_letters): New static constant, if
!defined _NL_CURRENT && (HAVE_ONLY_C_LOCALE || (USE_C_LOCALE &&
!HAVE_STRFTIME_L)).
(ampm): Use it if needed.

8 weeks agotests: Use strnul.
Bruno Haible [Sun, 1 Mar 2026 13:44:32 +0000 (14:44 +0100)] 
tests: Use strnul.

* tests/test-dfa-match-aux.c (main): Use strnul.
* tests/test-pthread-rwlock-waitqueue.c (reader_func, writer_func):
Likewise.
* tests/test-strtold.h (test_function): Likewise.
* tests/test-xstrtold.c (main): Likewise.
* modules/dfa-tests (Depends-on): Add strnul.
* modules/pthread-rwlock-extra-tests (Depends-on): Likewise.
* modules/c-strtold-tests (Depends-on): Likewise.
* modules/strtold-tests (Depends-on): Likewise.
* modules/xstrtold-tests (Depends-on): Likewise.

8 weeks agoFix last few ChangeLog entries.
Bruno Haible [Sun, 1 Mar 2026 13:44:13 +0000 (14:44 +0100)] 
Fix last few ChangeLog entries.

8 weeks agotests: Use memeq, part 3.
Bruno Haible [Sun, 1 Mar 2026 11:37:49 +0000 (12:37 +0100)] 
tests: Use memeq, part 3.

* tests/**/*.[hc]: Use memeq instead of memcmp.
* modules/*-tests (Dependencies): Add memeq.

8 weeks agotests: Use memeq, part 2.
Bruno Haible [Sun, 1 Mar 2026 11:36:45 +0000 (12:36 +0100)] 
tests: Use memeq, part 2.

Done through
  sed -e 's/memcmp \([(][^()]*[)]\) != 0/!memeq \1/g' \
      -e 's/memcmp \([(][^()]*[(][^()]*[)][^()]*[)]\) != 0/!memeq \1/g'

* tests/**/*.[hc]: Use !memeq instead of memcmp ... != 0.
* modules/*-tests (Dependencies): Add memeq.

8 weeks agotests: Use memeq, part 1.
Bruno Haible [Sun, 1 Mar 2026 11:35:40 +0000 (12:35 +0100)] 
tests: Use memeq, part 1.

Done through
  sed -e 's/memcmp \([(][^()]*[)]\) == 0/memeq \1/g' \
      -e 's/memcmp \([(][^()]*[(][^()]*[)][^()]*[)]\) == 0/memeq \1/g'

* tests/**/*.[hc]: Use memeq instead of memcmp ... == 0.
* modules/*-tests (Dependencies): Add memeq.

8 weeks agotests: Use streq, part 4.
Bruno Haible [Sun, 1 Mar 2026 09:50:12 +0000 (10:50 +0100)] 
tests: Use streq, part 4.

* tests/**/*.[hc]: Use streq instead of STREQ.
* tests/macros.h (STREQ): Remove macro.
* modules/*-tests (Dependencies): Add streq.

8 weeks agotests: Use streq, part 3.
Bruno Haible [Sun, 1 Mar 2026 09:15:23 +0000 (10:15 +0100)] 
tests: Use streq, part 3.

* tests/**/*.[hc]: Use streq instead of strcmp.
* modules/*-tests (Dependencies): Add streq.

8 weeks agotests: Use streq, part 2.
Bruno Haible [Sun, 1 Mar 2026 09:01:29 +0000 (10:01 +0100)] 
tests: Use streq, part 2.

Done through sed -e 's/strcmp \([(][^()]*[)]\) != 0/!streq \1/'

* tests/**/*.[hc]: Use !streq instead of strcmp ... != 0.
* modules/*-tests (Dependencies): Add streq.

8 weeks agotests: Use streq, part 1.
Bruno Haible [Sun, 1 Mar 2026 08:23:18 +0000 (09:23 +0100)] 
tests: Use streq, part 1.

Done through sed -e 's/strcmp \([(][^()]*[)]\) == 0/streq \1/'

* tests/**/*.[hc]: Use streq instead of strcmp ... == 0.
* modules/*-tests (Dependencies): Add streq.

8 weeks agofilesystem-remote: New module.
Bruno Haible [Sat, 28 Feb 2026 21:13:14 +0000 (22:13 +0100)] 
filesystem-remote: New module.

* lib/filesystem-remote.h: New file, based on lib/file-remote.h.
* lib/filesystem-remote.c: New file, based on lib/file-remote.c.
* lib/file-remote.h (is_remote_fs_type_name): Remove declaration.
* lib/file-remote.c (is_remote_fs_type_name): Remove function.
* modules/filesystem-remote: New file.
* lib/mountlist.c: Include filesystem-remote.h instead of file-remote.h.
* modules/mountlist (Depends-on): Add filesystem-remote. Remove
file-remote.

8 weeks agocygpath: Use _GL_ATTRIBUTE_MALLOC and _GL_ATTRIBUTE_DEALLOC_FREE.
Collin Funk [Sat, 28 Feb 2026 20:59:50 +0000 (12:59 -0800)] 
cygpath: Use _GL_ATTRIBUTE_MALLOC and _GL_ATTRIBUTE_DEALLOC_FREE.

* lib/cygpath.h: Include stdlib.h for free declaration.
(cygpath_w): Mark function with _GL_ATTRIBUTE_MALLOC and
_GL_ATTRIBUTE_DEALLOC_FREE since it will always return a malloc'ed
pointer or NULL.

8 weeks agofile-remote: Use streq.
Bruno Haible [Sat, 28 Feb 2026 20:45:08 +0000 (21:45 +0100)] 
file-remote: Use streq.

* lib/file-remote.c (is_remote_fs_type_name, file_is_remote): Use streq
instead of strcmp.
* modules/file-remote (Depends-on): Add streq.

8 weeks agoStraighten dependencies to streq or memeq.
Bruno Haible [Sat, 28 Feb 2026 17:44:42 +0000 (18:44 +0100)] 
Straighten dependencies to streq or memeq.

* modules/argmatch (Dependencies): Add memeq, streq. Remove stringeq.
* modules/bcp47 (Dependencies): Likewise.
* modules/readutmp (Dependencies): Likewise.
* modules/relocatable-prog (Dependencies): Likewise.
* modules/relocatable-prog-wrapper (Dependencies): Likewise.
* modules/vc-mtime (Dependencies): Likewise.
* modules/backup-rename (Dependencies): Add memeq. Remove stringeq.
* modules/backupfile (Dependencies): Likewise.
* modules/boot-time (Dependencies): Likewise.
* modules/csharpcomp (Dependencies): Likewise.
* modules/csharpexec (Dependencies): Likewise.
* modules/file-has-acl (Dependencies): Likewise.
* modules/get_ppid_of (Dependencies): Likewise.
* modules/get_progname_of (Dependencies): Likewise.
* modules/getlogin_r (Dependencies): Likewise.
* modules/getprogname (Dependencies): Likewise.
* modules/getumask (Dependencies): Likewise.
* modules/isnan-no-c++ (Dependencies): Likewise.
* modules/isnanf (Dependencies): Likewise.
* modules/isnanf-nolibm (Dependencies): Likewise.
* modules/isnand (Dependencies): Likewise.
* modules/isnand-nolibm (Dependencies): Likewise.
* modules/isnanl (Dependencies): Likewise.
* modules/isnanl-nolibm (Dependencies): Likewise.
* modules/mbchar (Dependencies): Likewise.
* modules/mem-hash-map (Dependencies): Likewise.
* modules/memcoll (Dependencies): Likewise.
* modules/progname (Dependencies): Likewise.
* modules/pthread_sigmask (Dependencies): Likewise.
* modules/quotearg (Dependencies): Likewise.
* modules/same (Dependencies): Likewise.
* modules/signbit-no-c++ (Dependencies): Likewise.
* modules/string-desc (Dependencies): Likewise.
* modules/uniname/uniname (Dependencies): Likewise.
* modules/acl-permissions (Dependencies): Add streq. Remove stringeq.
* modules/argp (Dependencies): Likewise.
* modules/c-vasnprintf (Dependencies): Likewise.
* modules/c32_get_mapping (Dependencies): Likewise.
* modules/c32_get_type_test (Dependencies): Likewise.
* modules/concat-filename (Dependencies): Likewise.
* modules/cpu-supports (Dependencies): Likewise.
* modules/dfa (Dependencies): Likewise.
* modules/duplocale (Dependencies): Likewise.
* modules/exclude (Dependencies): Likewise.
* modules/findprog (Dependencies): Likewise.
* modules/findprog-in (Dependencies): Likewise.
* modules/findprog-lgpl (Dependencies): Likewise.
* modules/fopen (Dependencies): Likewise.
* modules/fopen-gnu (Dependencies): Likewise.
* modules/freopen (Dependencies): Likewise.
* modules/fts (Dependencies): Likewise.
* modules/getlocalename_l-simple (Dependencies): Likewise.
* modules/getlocalename_l-unsafe (Dependencies): Likewise.
* modules/getlogin (Dependencies): Likewise.
* modules/getugroups (Dependencies): Likewise.
* modules/hard-locale (Dependencies): Likewise.
* modules/hashcode-named-file (Dependencies): Likewise.
* modules/hashkey-string (Dependencies): Likewise.
* modules/iconv_open (Dependencies): Likewise.
* modules/idcache (Dependencies): Likewise.
* modules/localcharset (Dependencies): Likewise.
* modules/localename (Dependencies): Likewise.
* modules/localename-environ (Dependencies): Likewise.
* modules/localename-unsafe (Dependencies): Likewise.
* modules/localename-unsafe-limited (Dependencies): Likewise.
* modules/map-c++-tests (Dependencies): Likewise.
* modules/mbs_endswith (Dependencies): Likewise.
* modules/mountlist (Dependencies): Likewise.
* modules/newlocale (Dependencies): Likewise.
* modules/nl_langinfo (Dependencies): Likewise.
* modules/nproc (Dependencies): Likewise.
* modules/open (Dependencies): Likewise.
* modules/parse-datetime (Dependencies): Likewise.
* modules/popen (Dependencies): Likewise.
* modules/posix_spawn-internal (Dependencies): Likewise.
* modules/propername (Dependencies): Likewise.
* modules/pt_chown (Dependencies): Likewise.
* modules/putenv-gnu (Dependencies): Likewise.
* modules/qcopy-acl (Dependencies): Likewise.
* modules/rpmatch (Dependencies): Likewise.
* modules/selinux-h (Dependencies): Likewise.
* modules/setlocale (Dependencies): Likewise.
* modules/setlocale-fixes (Dependencies): Likewise.
* modules/sig2str (Dependencies): Likewise.
* modules/spawn-pipe (Dependencies): Likewise.
* modules/stat (Dependencies): Likewise.
* modules/str_endswith (Dependencies): Likewise.
* modules/streq-opt (Dependencies): Likewise.
* modules/striconveha (Dependencies): Likewise.
* modules/supersede (Dependencies): Likewise.
* modules/time_rz (Dependencies): Likewise.
* modules/unicodeio (Dependencies): Likewise.
* modules/unistdio/u16-u16-vasnprintf (Dependencies): Likewise.
* modules/unistdio/u16-vasnprintf (Dependencies): Likewise.
* modules/unistdio/u32-u32-vasnprintf (Dependencies): Likewise.
* modules/unistdio/u32-vasnprintf (Dependencies): Likewise.
* modules/unistdio/u8-u8-vasnprintf (Dependencies): Likewise.
* modules/unistdio/u8-vasnprintf (Dependencies): Likewise.
* modules/unistdio/ulc-vasnprintf (Dependencies): Likewise.
* modules/vasnprintf (Dependencies): Likewise.
* modules/vasnwprintf (Dependencies): Likewise.
* modules/wctrans (Dependencies): Likewise.
* modules/wctype (Dependencies): Likewise.
* modules/c-nstrftime (Dependencies): Add streq.
* modules/fprintftime (Dependencies): Likewise.
* modules/nstrftime (Dependencies): Likewise.
* modules/nstrftime-limited (Dependencies): Likewise.

8 weeks agostreq, memeq: New modules.
Bruno Haible [Sat, 28 Feb 2026 15:36:24 +0000 (16:36 +0100)] 
streq, memeq: New modules.

* lib/string.in.h (_GL_STRING_INLINE): Remove macro.
(_GL_MEMEQ_INLINE): New macro.
(memeq): Use it instead of _GL_STRING_INLINE. Test GNULIB_MEMEQ.
(_GL_STREQ_INLINE): New macro.
(streq): Use it instead of _GL_STRING_INLINE. Test GNULIB_STREQ.
* lib/memeq.c: New file.
* lib/streq.c: New file.
* lib/string.c: Remove file.
* m4/memeq.m4: New file, based on m4/stringeq.m4.
* m4/streq.m4: New file, based on m4/stringeq.m4.
* m4/stringeq.m4: Remove file.
* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Initialize
GNULIB_MEMEQ, GNULIB_STREQ. Don't initialize GNULIB_STRINGEQ.
* modules/string-h (Makefile.am): Substitute GNULIB_MEMEQ, GNULIB_STREQ.
Don't substitute GNULIB_STRINGEQ.
* modules/memeq: New file.
* modules/streq: New file.
* modules/stringeq: Change to just be the union of streq and memeq.
* MODULES.html.sh (func_all_modules): Add memeq, streq.

8 weeks agoFix module dependencies after 2025-09-17 "stringeq: prefer streq to strcmp in other...
Bruno Haible [Sat, 28 Feb 2026 15:35:50 +0000 (16:35 +0100)] 
Fix module dependencies after 2025-09-17 "stringeq: prefer streq to strcmp in other modules".

* modules/c-vasnprintf (Dependencies): Add stringeq.
* modules/findprog-lgpl (Dependendies): Likewise.
* modules/localename-environ (Dependendies): Likewise.
* modules/localename-unsafe-limited (Dependendies): Likewise.
* modules/uchar-h-c23 (Dependendies): Likewise.
* modules/unistdio/u16-u16-vasnprintf (Dependendies): Likewise.
* modules/unistdio/u16-vasnprintf (Dependendies): Likewise.
* modules/unistdio/u32-u32-vasnprintf (Dependendies): Likewise.
* modules/unistdio/u32-vasnprintf (Dependendies): Likewise.
* modules/unistdio/u8-u8-vasnprintf (Dependendies): Likewise.
* modules/unistdio/u8-vasnprintf (Dependendies): Likewise.
* modules/unistdio/ulc-vasnprintf (Dependendies): Likewise.
* modules/vasnprintf (Dependendies): Likewise.
* modules/vasnwprintf (Dependendies): Likewise.
* modules/setenv (Dependendies): Remove stringeq.
* modules/uchar-h (Dependendies): Likewise.
* modules/uniconv/base (Dependendies): Likewise.

8 weeks agoFix module dependencies after 2025-09-17 "stringeq: prefer memeq to memcmp in other...
Bruno Haible [Sat, 28 Feb 2026 15:02:49 +0000 (16:02 +0100)] 
Fix module dependencies after 2025-09-17 "stringeq: prefer memeq to memcmp in other modules".

* modules/backup-rename (Dependencies): Add stringeq.
* modules/isnanf (Dependendies): Likewise.
* modules/isnanf-nolibm (Dependendies): Likewise.
* modules/isnand (Dependendies): Likewise.
* modules/isnand-nolibm (Dependendies): Likewise.
* modules/isnanl (Dependendies): Likewise.
* modules/isnanl-nolibm (Dependendies): Likewise.

8 weeks agomountlist: use file-remote module to determine remoteness
Pádraig Brady [Mon, 23 Feb 2026 14:22:51 +0000 (14:22 +0000)] 
mountlist: use file-remote module to determine remoteness

* lib/file-remote.c (is_remote_fs_type_name): A new function
that matches file system _names_ as being remote.  The list is
an amalgamation of those names already referenced in file-remote,
names referenced in ME_REMOTE, and IDs referenced in file-remote.
* lib/file-remote.h: Declare new function.
* lib/mountlist.c (ME_REMOTE): Use is_remote_fs_type_name()
to determine if the name is remote.
* modules/mountlist: Depend on file-remote.

8 weeks agostrnul: Fix link-time error.
Bruno Haible [Sat, 28 Feb 2026 08:04:14 +0000 (09:04 +0100)] 
strnul: Fix link-time error.

* lib/string.in.h (_GL_STRNUL_INLINE): New macro.
(gl_strnul): Use it instead of _GL_STRING_INLINE.
* lib/strnul.c: New file.
* lib/string.c: Update comment.
* modules/strnul (Files): Add strnul.c. Remove string.c.
(Makefile.am): Update accordingly.

8 weeks agowctype-h: Try to fix error regarding mbstate_t on very old mingw.
Bruno Haible [Fri, 27 Feb 2026 10:47:19 +0000 (11:47 +0100)] 
wctype-h: Try to fix error regarding mbstate_t on very old mingw.

Reported by Eli Zaretskii, see
<https://lists.gnu.org/archive/html/bug-gnulib/2026-01/msg00206.html>.
Based on proposed patch at
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00043.html>.

* lib/wctype.in.h: Don't include <wchar.h> on mingw when it has already
been at least partially processed.

2 months agombs_startswith: Add tests.
Bruno Haible [Fri, 27 Feb 2026 05:41:31 +0000 (06:41 +0100)] 
mbs_startswith: Add tests.

* tests/test-mbs_startswith1.c: New file, based on
tests/test-mbs_endswith1.c.
* tests/test-mbs_startswith2.c: New file, based on
tests/test-mbs_endswith2.c.
* tests/test-mbs_startswith2.sh: New file, based on
tests/test-mbs_endswith2.sh.
* tests/test-mbs_startswith3.c: New file, based on
tests/test-mbs_endswith3.c.
* tests/test-mbs_startswith3.sh: New file, based on
tests/test-mbs_endswith3.sh.
* modules/mbs_startswith-tests: New file.

2 months agombs_startswith: Fix handling of incomplete characters.
Bruno Haible [Fri, 27 Feb 2026 05:37:55 +0000 (06:37 +0100)] 
mbs_startswith: Fix handling of incomplete characters.

* lib/string.in.h (mbs_startswith): Remove macro definition.
* lib/mbs_startswith.c: New file.
* modules/mbs_startswith (Files): Add it.
(Depends-on): Add strnlen, mbiter.
(Makefile.am): Arrange to compile mbs_startswith.c.

2 months agoassert: document variadic variant
Paul Eggert [Wed, 25 Feb 2026 17:41:30 +0000 (09:41 -0800)] 
assert: document variadic variant

2 months agocrypto/sha3: Silence -Wzero-as-null-pointer-constant warning.
Collin Funk [Tue, 24 Feb 2026 05:32:25 +0000 (21:32 -0800)] 
crypto/sha3: Silence -Wzero-as-null-pointer-constant warning.

* lib/sha3.c (sha3_read_ctx): Use NULL for the pointer argument.

2 months agoUse strnul in a few places.
Alejandro Colomar [Tue, 24 Feb 2026 01:59:14 +0000 (02:59 +0100)] 
Use strnul in a few places.

* lib/argz.c (argz_next): Use strnul.
* lib/cpu-supports.c (hwcap_allowed): Likewise.
* lib/file-has-acl.c (aclinfo_has_xattr): Likewise.
* lib/inet_ntop.c (inet_ntop6): Likewise.
* lib/link.c (link): Likewise.
* lib/localename-unsafe.c (enum_locales_fn): Likewise.
* lib/mbspcasecmp.c (mbspcasecmp): Likewise.
* lib/opendir.c (opendir): Likewise.
* lib/parse-duration.c (parse_year_month_day, parse_hour_minute_second,
trim): Likewise.
* lib/setlocale.c (setlocale_unixlike): Likewise.
* lib/strftime.c (__strftime_internal): Likewise.
* lib/striconv.c (str_cd_iconv): Likewise.
* lib/strncat.c (strncat): Likewise.
* lib/term-style-control.c (log_signal_handler_called,
tcsetattr_failed): Likewise.
* lib/time_rz.c (save_abbr): Likewise.
* lib/vc-mtime.c (git_mtime, max_vc_mtime): Likewise.
* tests/test-savedir.c (test_savedir_sort_none, test_savedir_sort_name):
Likewise.
* modules/argz (Depends-on): Add strnul.
* modules/cpu-supports (Depends-on): Likewise.
* modules/file-has-acl (Depends-on): Likewise.
* modules/inet_ntop (Depends-on): Likewise.
* modules/link (Depends-on): Likewise.
* modules/localename-unsafe (Depends-on): Likewise.
* modules/localename-unsafe-limited (Depends-on): Likewise.
* modules/mbspcasecmp (Depends-on): Likewise.
* modules/opendir (Depends-on): Likewise.
* modules/parse-duration (Depends-on): Likewise.
* modules/setlocale (Depends-on): Likewise.
* modules/nstrftime (Depends-on): Likewise.
* modules/nstrftime-limited (Depends-on): Likewise.
* modules/c-nstrftime (Depends-on): Likewise.
* modules/fprintftime (Depends-on): Likewise.
* modules/striconv (Depends-on): Likewise.
* modules/strncat (Depends-on): Likewise.
* modules/term-style-control (Depends-on): Likewise.
* modules/time_rz (Depends-on): Likewise.
* modules/vc-mtime (Depends-on): Likewise.
* modules/savedir-tests (Depends-on): Likewise.

Copyright-paperwork-exempt: Yes

2 months agostrnul: Respect GNULIB_NAMESPACE.
Bruno Haible [Tue, 24 Feb 2026 00:13:43 +0000 (01:13 +0100)] 
strnul: Respect GNULIB_NAMESPACE.

* lib/string.in.h (strnul): Use _GL_BEGIN_NAMESPACE, _GL_END_NAMESPACE.
* tests/test-strnul-c++2.cc: New file, based on tests/test-strnul.c.
* modules/strnul-c++-tests (Files): Add it.
(Makefile.am): Arrange to compile and run test-strnul-c++2.

2 months agostrnul: Accept 'void *' and 'const void *' arguments in C mode.
Bruno Haible [Mon, 23 Feb 2026 14:07:30 +0000 (15:07 +0100)] 
strnul: Accept 'void *' and 'const void *' arguments in C mode.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00170.html>.

* lib/string.in.h (strnul): Use a conditional expression in _Generic.
* tests/test-strnul.c (main): Add test cases with 'void *' argument.

2 months agofts: Relicense some of its source code under LGPLv2+.
Bruno Haible [Mon, 23 Feb 2026 08:40:09 +0000 (09:40 +0100)] 
fts: Relicense some of its source code under LGPLv2+.

Jim Meyering's permission is at
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00109.html>.
Paul Eggert's permission is at
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00106.html>.
Bruno Haible's permission is at
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00111.html>.
Pádraig Brady's permission is at
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00113.html>.
Kamil Dudka's permission is at
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00199.html>.

* lib/fts.in.h: Change license notice to LGPLv2+.
* lib/fts.c: Likewise.
* lib/fts-cycle.c: Likewise.

2 months agoFix comment misspelling of "against"
Paul Eggert [Mon, 23 Feb 2026 02:42:30 +0000 (18:42 -0800)] 
Fix comment misspelling of "against"

2 months agocrypto: don’t add 72 to malloc size
Paul Eggert [Mon, 23 Feb 2026 01:13:58 +0000 (17:13 -0800)] 
crypto: don’t add 72 to malloc size

The ‘BLOCKSIZE + 72’ business apparently dates back to 30 years
ago when the buffer was local (not heap allocated) and was multi-use.
That code died long ago, so stop allocating the cargo-cult bytes.
* lib/md2-stream.c (md2_stream):
* lib/md4-stream.c (md4_stream):
* lib/md5-stream.c (md5_stream):
* lib/sha1-stream.c (sha1_stream):
* lib/sha256-stream.c (shaxxx_stream):
* lib/sha3-stream.c (sha3_xxx_stream):
* lib/sha512-stream.c (shaxxx_stream):
* lib/sm3-stream.c (sm3_stream):
Don’t allocate an unnecessary 72 extra bytes.

2 months agosha3: add a few ‘restrict’s that I forgot
Paul Eggert [Mon, 23 Feb 2026 00:36:11 +0000 (16:36 -0800)] 
sha3: add a few ‘restrict’s that I forgot

* lib/sha3-stream.c (sha3_xxx_stream):
* lib/sha3.c (sha3_##SIZE##_buffer):
Add some more ‘restrict’s.

2 months agocrypto: add ‘restrict’ to .h files
Paul Eggert [Sun, 22 Feb 2026 23:08:59 +0000 (15:08 -0800)] 
crypto: add ‘restrict’ to .h files

Use ‘restrict’ on pointer args when appropriate.
It suffices to do this in .h files, as .c files inherit it.
For style, prefer qualifiers after types, to be consistent with
putting ‘restrict’ after types.
* lib/af_alg.h (afalg_buffer, afalg_stream):
* lib/arcfour.h (arcfour_stream, arcfour_setkey):
* lib/arctwo.h (arctwo_setkey_ekb, arctwo_encrypt, arctwo_decrypt):
* lib/des.h (gl_des_setkey, gl_des_makekey, gl_des_ecb_crypt)
(gl_3des_set2keys, gl_3des_set3keys, gl_3des_makekey)
(gl_3des_ecb_crypt):
* lib/gc.h (gc_cipher_setkey, gc_cipher_setiv)
(gc_cipher_encrypt_inline, gc_cipher_decrypt_inline, gc_hash_clone)
(gc_hash_hmac_setkey, gc_hash_write, gc_hash_buffer, gc_md2)
(gc_md4, gc_md5, gc_sha1, gc_sha256, gc_sha512, gc_sm3)
(gc_hmac_md5, gc_hmac_sha1, gc_hmac_sha256, gc_hmac_sha512)
(gc_pbkdf2_hmac, gc_pbkdf2_sha1):
* lib/gl_openssl.h (GL_CRYPTO_FN (_process_bytes))
(GL_CRYPTO_FN (_process_block), GL_CRYPTO_FN (_finish_ctx))
(GL_CRYPTO_FN (_buffer), GL_CRYPTO_FN (_read_ctx)):
* lib/hmac.h (hmac_md5, hmac_sha1, hmac_sha256, hmac_sha512):
* lib/md2.h (md2_process_block, md2_process_bytes, md2_finish_ctx)
(md2_read_ctx, md2_buffer, md2_stream):
* lib/md4.h (md4_process_block, md4_process_bytes, md4_finish_ctx)
(md4_read_ctx, md4_buffer, md4_stream):
* lib/md5.h (__md5_process_block, __md5_process_bytes, __md5_finish_ctx)
(__md5_read_ctx, __md5_buffer, __md5_stream):
* lib/rijndael-alg-fst.h (rijndaelKeySetupEnc)
(rijndaelKeySetupDec, rijndaelEncrypt, rijndaelDecrypt):
* lib/rijndael-api-fst.h (rijndaelMakeKey, rijndaelCipherInit)
(rijndaelBlockEncrypt, rijndaelPadEncrypt, rijndaelBlockDecrypt)
(rijndaelPadDecrypt):
* lib/sha1.h (sha1_process_block, sha1_process_bytes)
(sha1_finish_ctx, sha1_read_ctx, sha1_buffer, sha1_stream):
* lib/sha256.h (sha256_process_block, sha256_process_bytes)
(sha256_finish_ctx, sha224_finish_ctx, sha256_read_ctx)
(sha224_read_ctx, sha256_buffer, sha224_buffer, sha256_stream)
(sha224_stream):
* lib/sha3.h (sha3_process_block, sha3_process_bytes)
(sha3_finish_ctx, sha3_read_ctx, sha3_224_buffer, sha3_256_buffer)
(sha3_384_buffer, sha3_512_buffer, sha3_224_stream)
(sha3_256_stream, sha3_384_stream, sha3_512_stream):
* lib/sha512.h (sha512_process_block, sha512_process_bytes)
(sha512_finish_ctx, sha384_finish_ctx, sha512_read_ctx)
(sha384_read_ctx, sha512_buffer, sha384_buffer, sha512_stream)
(sha384_stream):
* lib/sm3.h (sm3_process_block, sm3_process_bytes, sm3_finish_ctx)
(sm3_read_ctx, sm3_buffer, sm3_stream):
Add ‘restrict’ to pointer args.  All implementations changed.

2 months agocrypto/sha3: Don’t leak if init fails and no free
Paul Eggert [Sun, 22 Feb 2026 21:06:34 +0000 (13:06 -0800)] 
crypto/sha3: Don’t leak if init fails and no free

If the init_ctx functions fail, it’s natural for callers to
immediately fail too.  Change the init_ctx functions to not leak
when failing.  This doesn’t invalidate any callers that free
if the init functions fail, as that free now becomes a no-op.
* lib/sha3.c (sha3_##SIZE##_init_ctx): Before failing,
free any storage that was allocated before failure was discovered.
* tests/test-sha3-224-buffer.c:
* tests/test-sha3-256-buffer.c:
* tests/test-sha3-384-buffer.c:
* tests/test-sha3-512-buffer.c:
(check, main): Test more cases of multiple frees.
Also, fix a memory leak.

2 months agocrypto/sha3: fix sha3_read_ctx reset bug
Paul Eggert [Sun, 22 Feb 2026 19:51:26 +0000 (11:51 -0800)] 
crypto/sha3: fix sha3_read_ctx reset bug

* lib/sha3.c (sha3_read_ctx): When using OpenSSL, don’t update the
internal context; we’re supposed to read it, not write it.
Instead, clone it and update the clone.
* tests/test-sha3-224-buffer.c:
* tests/test-sha3-256-buffer.c:
* tests/test-sha3-384-buffer.c:
* tests/test-sha3-512-buffer.c:
(check): Test for the bug.

2 months agocrypto/sha3: EVP_MD_CTX_create → EVP_MD_CTX_new
Paul Eggert [Sun, 22 Feb 2026 18:11:12 +0000 (10:11 -0800)] 
crypto/sha3: EVP_MD_CTX_create → EVP_MD_CTX_new

* lib/sha3.c (sha3_##SIZE##_init_ctx): Avoid deprecated macro name.

2 months agocrypto/sha3: fix errno when freeing
Paul Eggert [Sun, 22 Feb 2026 17:58:37 +0000 (09:58 -0800)] 
crypto/sha3: fix errno when freeing

* lib/sha3.c (sha3_free_ctx): Preserve errno.
* modules/crypto/sha3 (Depends-on):
* modules/crypto/sha3-buffer (Depends-on):
Depend on free-posix.

2 months agocrypto/sha3: fix memory leak with OpenSSL wrapper
Paul Eggert [Sun, 22 Feb 2026 17:52:17 +0000 (09:52 -0800)] 
crypto/sha3: fix memory leak with OpenSSL wrapper

* lib/sha3.c (sha3_##SIZE##_buffer):
Free ctx before returning.

* lib/sha3.c (sha3_process_bytes): Simplify, and replace * with -.

2 months agocrypto/sha3: simplify full-block processing
Paul Eggert [Sun, 22 Feb 2026 17:24:45 +0000 (09:24 -0800)] 
crypto/sha3: simplify full-block processing

* lib/sha3.c (sha3_process_bytes): Simplify.

2 months agocrypto/sha3: fix partial-buffer bug
Paul Eggert [Sun, 22 Feb 2026 16:53:14 +0000 (08:53 -0800)] 
crypto/sha3: fix partial-buffer bug

* lib/sha3.c (sha3_process_bytes):
Update ctx->buflen to 0 if all bytes were processed.
* tests/test-sha3-224-buffer.c:
* tests/test-sha3-256-buffer.c:
* tests/test-sha3-384-buffer.c:
* tests/test-sha3-512-buffer.c:
(mismatch): New function.
(check): Check for the bug.

2 months agostrnul-bench-tests: New module.
Bruno Haible [Sun, 22 Feb 2026 07:58:11 +0000 (08:58 +0100)] 
strnul-bench-tests: New module.

* tests/bench-strnul.c: New file.
* modules/strnul-bench-tests: New file.

2 months agocdefs: omit ungrammatical (and unnecessary) #error
Paul Eggert [Sat, 21 Feb 2026 23:25:40 +0000 (15:25 -0800)] 
cdefs: omit ungrammatical (and unnecessary) #error

* lib/cdefs.h: Remove an ungrammatical #error diagnostic
that is not needed any more, now that people no longer
try to use glibc or Gnulib with K&R C compilers.

2 months agocdefs: merge from glibc
Paul Eggert [Sat, 21 Feb 2026 23:23:26 +0000 (15:23 -0800)] 
cdefs: merge from glibc

Also, minimize whitespace differences from glibc,
to simplify comparison.
* lib/cdefs.h: Do not issue header warning if C++.
(__COLD, __attribute_overloadable__, __REDIRECT_FORTIFY)
(__REDIRECT_FORTIFY_NTH, __glibc_const_generic)
(__attribute_struct_may_alias__): New macros.
Several other new macros are defined if !__GNULIB_CDEFS.
(__glibc_safe_or_unknown_len): Check that __osz is a constant.
(__REDIRECT_LDBL): Optimize error redirects for ieeelongdouble.
(__fortified_attr_access): Drop access attribute for _FORTIFY_SOURCE=3.

2 months agostrnul: Add tests.
Bruno Haible [Sat, 21 Feb 2026 09:28:11 +0000 (10:28 +0100)] 
strnul: Add tests.

* tests/test-strnul.c: New file.
* tests/test-strnul-c++.cc: New file.
* modules/strnul-tests: New file.
* modules/strnul-c++-tests: New file.

2 months agostrnul: New module.
Bruno Haible [Sat, 21 Feb 2026 09:26:13 +0000 (10:26 +0100)] 
strnul: New module.

Suggested by Alejandro Colomar <alx@kernel.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00121.html>.

* lib/string.in.h (gl_strnul): New function.
(strnul): New macro or template.
* lib/string.c: Update comment.
* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Initialize
GNULIB_STRNUL.
* modules/string-h (Makefile.am): Substitute GNULIB_STRNUL.
* modules/strnul: New file.

2 months agostreq: Rename to streq-opt.
Bruno Haible [Sat, 21 Feb 2026 07:02:52 +0000 (08:02 +0100)] 
streq: Rename to streq-opt.

* lib/streq-opt.h: Renamed from lib/streq.h.
* modules/streq-opt: Renamed from modules/streq.
* NEWS: Mention the change.
* lib/c32is-impl.h: Include streq-opt.h instead of streq.h.
* lib/c32to-impl.h: Likewise.
* lib/c32rtomb.c: Likewise.
* lib/c32width.c: Likewise.
* lib/lc-charset-dispatch.c: Likewise.
* lib/lc-charset-unicode.c: Likewise.
* lib/mbrtoc32.c: Likewise.
* lib/uniwidth/cjk.h: Likewise.
* lib/wcwidth.c: Likewise.
* modules/c32is* (Depends-on): Add streq-opt. Remove streq.
* modules/c32to* (Depends-on): Likewise.
* modules/c32rtomb (Depends-on): Likewise.
* modules/mbrtoc32 (Depends-on): Likewise.
* modules/mbrtowc (Depends-on): Likewise.
* modules/uchar-h-c23 (Depends-on): Likewise.
* modules/unilbrk/u*-possible-linebreaks (Depends-on): Likewise.
* modules/uniwidth/width (Depends-on): Likewise.
* modules/wcwidth (Depends-on): Likewise.
* MODULES.html.sh: Update.

2 months agocsharpcomp: Use str_endswith.
Bruno Haible [Sat, 21 Feb 2026 00:48:07 +0000 (01:48 +0100)] 
csharpcomp: Use str_endswith.

Suggested by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00129.html>.

* lib/csharpcomp.c (compile_csharp_using_mono,
compile_csharp_using_dotnet, compile_csharp_using_sscli,
compile_csharp_class): Use str_endswith.
* modules/csharpcomp (Depends-on): Add str_endswith.

2 months agoSay B5000 and U1103 don’t do C23
Paul Eggert [Fri, 20 Feb 2026 21:54:10 +0000 (13:54 -0800)] 
Say B5000 and U1103 don’t do C23

2 months agoMention CheriBSD as tested
Paul Eggert [Fri, 20 Feb 2026 21:52:39 +0000 (13:52 -0800)] 
Mention CheriBSD as tested

2 months agodoc: fix ChangeLog and mention xlc versions
Paul Eggert [Fri, 20 Feb 2026 21:29:25 +0000 (13:29 -0800)] 
doc: fix ChangeLog and mention xlc versions

2 months agoi-ring: Relicense under LGPLv2+.
Bruno Haible [Fri, 20 Feb 2026 12:50:45 +0000 (13:50 +0100)] 
i-ring: Relicense under LGPLv2+.

* modules/i-ring (License): Change to LGPLv2+.
* lib/i-ring.h: Update license notice.
* lib/i-ring.c: Likewise.

2 months agocycle-check: Relicense under LGPLv2+.
Bruno Haible [Thu, 19 Feb 2026 14:00:04 +0000 (15:00 +0100)] 
cycle-check: Relicense under LGPLv2+.

Jim Meyering's permission is at
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00109.html>.
Paul Eggert's permission is at
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00106.html>.

* modules/cycle-check (License): Change to LGPLv2+.
* lib/cycle-check.h: Update license notice.
* lib/cycle-check.c: Likewise.

2 months agodev-ino: Relicense under LGPLv2+.
Bruno Haible [Thu, 19 Feb 2026 13:53:22 +0000 (14:53 +0100)] 
dev-ino: Relicense under LGPLv2+.

Jim Meyering's permission is at
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00109.html>.

* modules/dev-ino (License): Change to LGPLv2+.
* lib/dev-ino.h: Update license notice.

2 months agocpu-supports: Fix typos.
Collin Funk [Thu, 19 Feb 2026 03:02:58 +0000 (19:02 -0800)] 
cpu-supports: Fix typos.

* lib/cpu-supports.h (gcc_feature_to_glibc_hwcap): Fix typos in
comments.

2 months agocpu-supports: Add detection for Advanced SIMD (Neon) instructions.
Collin Funk [Thu, 19 Feb 2026 03:00:31 +0000 (19:00 -0800)] 
cpu-supports: Add detection for Advanced SIMD (Neon) instructions.

* lib/cpu-supports.h (gcc_feature_to_glibc_hwcap): Map "asimd" to
"-ASIMD". Add a comment on where to find aarch64 hwcaps in glibc.

2 months agoparse-datetime: avoid false test failure on windows
Pádraig Brady [Mon, 16 Feb 2026 11:21:57 +0000 (11:21 +0000)] 
parse-datetime: avoid false test failure on windows

* tests/test-parse-datetime.c: Tweak so that year 2003 rather than 0003
is used, as the latter is not supported by mktime on Windows or Cygwin.
Reported by Bruno Haible.

2 months agoHACKING: Add an LLM policy.
Bruno Haible [Mon, 16 Feb 2026 08:29:10 +0000 (09:29 +0100)] 
HACKING: Add an LLM policy.

* HACKING (Acceptable use of LLM generated code): New section.

2 months agoparse-datetime: Prefer ckd_add to checking overflow by hand.
Collin Funk [Sun, 15 Feb 2026 23:18:37 +0000 (15:18 -0800)] 
parse-datetime: Prefer ckd_add to checking overflow by hand.

* lib/parse-datetime.y (time_overflow): Use ckd_add to check for
overflow.

2 months agoUpdate users.txt.
Collin Funk [Sun, 15 Feb 2026 19:01:33 +0000 (11:01 -0800)] 
Update users.txt.

* users.txt: Add universal-ctags.

2 months agofchownat: port to IBM XL C for AIX 16.1
Paul Eggert [Sun, 15 Feb 2026 02:59:54 +0000 (18:59 -0800)] 
fchownat: port to IBM XL C for AIX 16.1

* lib/chown.c (rpl_chown):
* lib/fchownat.c (rpl_fchownat):
* lib/lchown.c (rpl_lchown):
Avoid using designated initializers (or even ordinary initializers)
in a way that provokes a bug in IBM XL C for AIX 16.1 (2018).
IBM says they will support this old compiler through April 2026
with extended support through April 2029.

2 months agostdcountof-h: port to IBM XL C for AIX 16.1
Paul Eggert [Sun, 15 Feb 2026 02:50:17 +0000 (18:50 -0800)] 
stdcountof-h: port to IBM XL C for AIX 16.1

Improve the test for the bug in MSVC and Oracle Developer Studio
so that it does not rely on symbols like _MSC_VER and so is more
likely to be portable to other compilers that have the bug, e.g.,
IBM XL C for AIX 16.1.  Also, document bug since countof exposes it.
* doc/posix-headers/stdcountof.texi: New file.
* tests/test-stdcountof-h.c (a, b, c): Remove these extern decls.
(call_count): New static var.
(do_call): New static function.
(test_func): Use it to test whether the compiler bug exists with
sizeof, and if so, to skip the countof test.

2 months agoobstack-printf-{posix,gnu}: Fix broken configuration result.
Bruno Haible [Sat, 14 Feb 2026 14:43:47 +0000 (15:43 +0100)] 
obstack-printf-{posix,gnu}: Fix broken configuration result.

Reported by Eric Blake in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00028.html>.

* m4/obstack-printf.m4 (gl_FUNC_OBSTACK_PRINTF_REPLACE): New macro,
extracted from gl_FUNC_OBSTACK_PRINTF.
(gl_FUNC_OBSTACK_PRINTF): Invoke it.
* m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_POSIX_REPLACE): New
macro, extracted from gl_FUNC_OBSTACK_PRINTF_POSIX.
(gl_FUNC_OBSTACK_PRINTF_POSIX): Require gl_FUNC_OBSTACK_PRINTF_REPLACE.
* m4/obstack-printf-gnu.m4 (gl_FUNC_OBSTACK_PRINTF_GNU_REPLACE): New
macro, extracted from gl_FUNC_OBSTACK_PRINTF_GNU.
(gl_FUNC_OBSTACK_PRINTF_GNU): Require gl_FUNC_OBSTACK_PRINTF_REPLACE.

2 months agocrypto/sha3-buffer: pacify -Wcast-qual
Paul Eggert [Thu, 12 Feb 2026 21:36:26 +0000 (13:36 -0800)] 
crypto/sha3-buffer: pacify -Wcast-qual

* lib/sha3.c (sha3_process_bytes): Pacify clang -Wcast-qual.

2 months agocrypto/rijndael: pacify -Wcast-qual
Paul Eggert [Thu, 12 Feb 2026 21:34:10 +0000 (13:34 -0800)] 
crypto/rijndael: pacify -Wcast-qual

* lib/rijndael-api-fst.c (rijndaelBlockEncrypt)
(rijndaelPadEncrypt): Pacify clang -Wcast-qual.

2 months agocrypto/*-buffer: propagate 'const'
Paul Eggert [Thu, 12 Feb 2026 21:02:48 +0000 (13:02 -0800)] 
crypto/*-buffer: propagate 'const'

Problem reported by Arun Giridhar in:
https://savannah.gnu.org/bugs/index.php?68042
* lib/gl_openssl.h (GL_CRYPTO_FN): Use a const pointer.

2 months agoparse-datetime: support dd.mm. in combination
Pádraig Brady [Mon, 9 Feb 2026 17:06:11 +0000 (17:06 +0000)] 
parse-datetime: support dd.mm. in combination

* lib/parse-datetime.y: The previous commit added DD.MM. and DD.MM.YYYY
grammar rules, plus lexer logic (NOT_DECIMAL flag) to prevent 17.6 from
being lexed as a single decimal token. The resulting shift/reduce
conflict between the two rules caused "1.2. 6:7:8.9" to consume 6 as
a year. Also the NOT_DECIMAL flag was never cleared in the DD.MM. case,
later preventing 8.9 from being lexed as a decimal.
  Since the lexer already distinguishes the contiguous 1.2.3 and spaced,
we introduce tUNUMBER_DOTTED so each rule expects different tokens,
thus removing the shift/reduce conflict.  Also we clear NOT_DECIMAL
in the normal path.
* tests/test-parse-datetime.c: Add test cases.

2 months agoparse-datetime: add tests for dd.mm.yy and mm/dd/yy formats
Pádraig Brady [Mon, 9 Feb 2026 15:36:46 +0000 (15:36 +0000)] 
parse-datetime: add tests for dd.mm.yy and mm/dd/yy formats

* tests/test-parse-datetime.c: Add test cases.

2 months agopoll: When setting POLLHUP in revents, set also POLLIN and POLLRDNORM.
Sergei Litvin [Mon, 9 Feb 2026 01:24:30 +0000 (02:24 +0100)] 
poll: When setting POLLHUP in revents, set also POLLIN and POLLRDNORM.

This fixes a hang of wget2 on Windows
<https://gitlab.com/gnuwget/wget2/-/issues/715>.

* lib/poll.c (windows_compute_revents_socket): Set POLLIN and POLLRDNORM
whenever lNetworkEvents has one of the bits FD_READ, FD_ACCEPT, FD_CLOSE
set.
(compute_revents): Set POLLIN and POLLRDNORM whenever fd is set in
rfds[].

Copyright-paperwork-exempt: Yes

2 months agocrypto/{sha*,md5}-buffer: Improve ./configure --help output.
Collin Funk [Tue, 10 Feb 2026 03:25:41 +0000 (19:25 -0800)] 
crypto/{sha*,md5}-buffer: Improve ./configure --help output.

* m4/gl-openssl.m4 (gl_CRYPTO_CHECK): Mention that --with-openssl=yes
will use libcrypto and --with-openssl=no will use a fallback
implementation provided by gnulib.

2 months agosignbit: Fix compil. error in C++ mode on macOS 14 (regr. 2026-02-03).
Bruno Haible [Mon, 9 Feb 2026 16:53:38 +0000 (17:53 +0100)] 
signbit: Fix compil. error in C++ mode on macOS 14 (regr. 2026-02-03).

* lib/math.in.h (signbit): Don't define as a template if the compiler
is clang.

2 months agoisnan: Fix compilation error in C++ mode on NetBSD (regr. 2026-02-03).
Bruno Haible [Mon, 9 Feb 2026 15:30:16 +0000 (16:30 +0100)] 
isnan: Fix compilation error in C++ mode on NetBSD (regr. 2026-02-03).

* lib/math.in.h (isnan): Undefine before defining as a template.

2 months agostrncpy: Change license header in sources to LGPLv2+.
Collin Funk [Sun, 8 Feb 2026 22:27:11 +0000 (14:27 -0800)] 
strncpy: Change license header in sources to LGPLv2+.

Bruno Haible authored this file and approved this change here
<https://lists.gnu.org/r/bug-gnulib/2026-02/msg00047.html>.

* lib/strncpy.c: Change license header to LGPLv2+.

2 months agoparse-datetime: support dd.mm.yy format
Gabriel [Sat, 7 Feb 2026 14:12:45 +0000 (14:12 +0000)] 
parse-datetime: support dd.mm.yy format

* doc/parse-datetime.texi: Document dd.mm.yy support.
* lib/parse-datetime.y: Add grammar for dd.mm.yy and dd.mm.,
and logic to distinguish from tUDECIMAL_NUMBER.

2 months agocpu-supports: fix license in source headers
Pádraig Brady [Sun, 8 Feb 2026 14:09:51 +0000 (14:09 +0000)] 
cpu-supports: fix license in source headers

* lib/cpu-supports.c: s/GPL/LGPL/ as per commit 2bad49a5f9.
* lib/cpu-supports.h: Likewise.
Reported by Collin Funk

2 months agodoc: Separate header files removed by POSIX.
Collin Funk [Sun, 8 Feb 2026 04:56:25 +0000 (20:56 -0800)] 
doc: Separate header files removed by POSIX.

* doc/pastposix-headers/stropts.texi: Renamed from
doc/posix-headers/stropts.texi.
* doc/pastposix-headers/sys_timeb.texi: Renamed from
doc/posix-headers/sys_timeb.texi.
* doc/pastposix-headers/trace.texi: Renamed from
doc/posix-headers/trace.texi.
* doc/pastposix-headers/ucontext.texi: Renamed from
doc/posix-headers/ucontext.texi.
* doc/pastposix-headers/ulimit.texi: Renamed from
doc/posix-headers/ulimit.texi.
* doc/pastposix-headers/utime.texi: Renamed from
doc/posix-headers/utime.texi.
* doc/Makefile (GNULIB_TEXI_FILES): Add files from
doc/pastposix-functions and doc/pastposix-headers.
* doc/gnulib.texi (Legacy Header File Substitutes): New node. Move
header files removed from POSIX here.

2 months agodoc: Fix links to headers removed in POSIX.1-2024 (regr. 2024-07-20).
Collin Funk [Sat, 7 Feb 2026 22:43:47 +0000 (14:43 -0800)] 
doc: Fix links to headers removed in POSIX.1-2024 (regr. 2024-07-20).

* doc/posix-headers/stropts.texi: Use the POSIX.1-2017 link where this
header exists.
* doc/posix-headers/trace.texi: Likewise.
* doc/posix-headers/ulimit.texi: Likewise.
* doc/posix-headers/utime.texi: Likewise.

2 months agogendocs: support compound $MAKEINFO
Pádraig Brady [Sat, 7 Feb 2026 21:10:47 +0000 (21:10 +0000)] 
gendocs: support compound $MAKEINFO

* build-aux/gendocs.sh: Use eval consistently with $MAKEINFO,
to support it being a compound command.  In coreutils at least,
it has the value: SHELL='/bin/sh' build-aux/makeinfo-wrapper.sh
Reported by Collin Funk.

2 months agomaintainer-makefile: propagate MAKEINFO to gendocs
Pádraig Brady [Mon, 2 Feb 2026 19:56:52 +0000 (19:56 +0000)] 
maintainer-makefile: propagate MAKEINFO to gendocs

* top/maint.mk (web-manual): Propagate MAKEINFO explicitly,
rather than requiring it exported in the environment,
which can be awkward on Solaris make for example.

2 months agodo-release-commit-and-tag: Fix stub line numbers.
Basil L. Contovounesios [Wed, 4 Feb 2026 13:52:47 +0000 (14:52 +0100)] 
do-release-commit-and-tag: Fix stub line numbers.

Reported by Pádraig Brady in
<https://lists.gnu.org/r/bug-gnulib/2026-02/msg00027.html>.
* build-aux/do-release-commit-and-tag: The stub_line number is
relative to the --stub-lines sed address, so offset it accordingly.

2 months agoautoupdate
Karl Berry [Wed, 4 Feb 2026 16:11:37 +0000 (08:11 -0800)] 
autoupdate

2 months agomaintainer-makefile: Avoid false positives of unsigned_* syntax checks.
Zack Weinberg [Tue, 3 Feb 2026 16:34:15 +0000 (11:34 -0500)] 
maintainer-makefile: Avoid false positives of unsigned_* syntax checks.

* top/maint.mk (sc_unsigned_char, sc_unsigned_short, sc_unsigned_int,
sc_unsigned_log): Add ‘exclude’ patterns so that these tests do not
throw a false positive on their own commentary.

Copyright-paperwork-exempt: Yes

2 months agoautoupdate
Karl Berry [Tue, 3 Feb 2026 17:16:41 +0000 (09:16 -0800)] 
autoupdate

2 months agomaintainer-makefile: Avoid false positive of fsf_postal syntax check.
Zack Weinberg [Tue, 3 Feb 2026 16:18:48 +0000 (11:18 -0500)] 
maintainer-makefile: Avoid false positive of fsf_postal syntax check.

* top/maint.mk (sc_fsf_postal): Adjust ‘prohibit’ regex to not match
itself.

Copyright-paperwork-exempt: Yes

2 months agosignbit: Make more C++ safe.
Bruno Haible [Tue, 3 Feb 2026 09:58:36 +0000 (10:58 +0100)] 
signbit: Make more C++ safe.

* lib/math.in.h (signbit): In C++ mode, define as a template with three
instantiations, instead of as a macro.

2 months agoisnan: Make more C++ safe.
Bruno Haible [Tue, 3 Feb 2026 09:52:13 +0000 (10:52 +0100)] 
isnan: Make more C++ safe.

* lib/math.in.h (isnan): In C++ mode, define as a template with three
instantiations, instead of as a macro.

2 months agoisinf: Make more C++ safe.
Bruno Haible [Tue, 3 Feb 2026 09:46:27 +0000 (10:46 +0100)] 
isinf: Make more C++ safe.

* lib/math.in.h (isinf): In C++ mode, define as a template with three
instantiations, instead of as a macro.

2 months agoisinf: Avoid unnecessary override of isinf().
Bruno Haible [Tue, 3 Feb 2026 00:58:16 +0000 (01:58 +0100)] 
isinf: Avoid unnecessary override of isinf().

* m4/isinf.m4 (gl_ISINFL_WORKS): Link the test program with -lm if
necessary.

2 months agoisfinite-no-c++: Avoid unnecessary override of isfinite().
Bruno Haible [Tue, 3 Feb 2026 00:30:28 +0000 (01:30 +0100)] 
isfinite-no-c++: Avoid unnecessary override of isfinite().

* m4/isfinite.m4 (gl_ISFINITEL_WORKS): Link the test program with -lm if
necessary.

2 months agofilename: warn re IS_RELATIVE_FILE_NAME ("")
Paul Eggert [Mon, 2 Feb 2026 21:06:51 +0000 (13:06 -0800)] 
filename: warn re IS_RELATIVE_FILE_NAME ("")

* lib/filename.h: Add warning that IS_RELATIVE_FILE_NAME ("") is 1.

2 months agogettext: Partially update to gettext 1.0.
Bruno Haible [Thu, 29 Jan 2026 18:28:59 +0000 (19:28 +0100)] 
gettext: Partially update to gettext 1.0.

* m4/gettext.m4: Update from gettext 1.0.
* m4/nls.m4: Likewise.
* m4/progtest.m4: Likewise.

2 months agorelocatable-prog-wrapper: Fix syntax error on Linux (regr. 2025-12-09).
Bruno Haible [Thu, 29 Jan 2026 18:04:32 +0000 (19:04 +0100)] 
relocatable-prog-wrapper: Fix syntax error on Linux (regr. 2025-12-09).

Reported by Erik Schnetter <schnetter@gmail.com>
at <https://savannah.gnu.org/bugs/?67987>.

* lib/progreloc.c (find_executable): Remove extraneous brace.

2 months agodoc: Fix some links to copy_file_range issues.
Collin Funk [Wed, 28 Jan 2026 03:32:01 +0000 (19:32 -0800)] 
doc: Fix some links to copy_file_range issues.

* doc/glibc-functions/copy_file_range.texi: Correct the order of
arguments to @url.