]> git.ipfire.org Git - thirdparty/gnulib.git/log
thirdparty/gnulib.git
7 months agoautoupdate
Karl Berry [Thu, 26 Jun 2025 14:40:04 +0000 (07:40 -0700)] 
autoupdate

7 months agokwset: Add tests.
Bruno Haible [Wed, 25 Jun 2025 13:52:40 +0000 (15:52 +0200)] 
kwset: Add tests.

* lib/kwset.c (kwsexec): Correct documentation.
* tests/test-kwset.c: New file.
* modules/kwset-tests: New file.

7 months agokwset: Usability tweaks.
Bruno Haible [Wed, 25 Jun 2025 12:28:25 +0000 (14:28 +0200)] 
kwset: Usability tweaks.

* lib/kwset.h: Make header idempotent and C++ safe. Check that config.h
was already included.

7 months agokwset: New module.
Bruno Haible [Wed, 25 Jun 2025 12:24:41 +0000 (14:24 +0200)] 
kwset: New module.

* lib/kwset.h: New file, from GNU grep.
* lib/kwset.c: New file, from GNU grep.
Include <limits.h>, minmax.h. Don't include system.h.
(IGNORE_DUPLICATE_BRANCH_WARNING): New macro, from grep/src/system.h.
(NCHAR): New enum value, from grep/src/system.h.
(to_uchar): New function, from grep/src/system.h.
* modules/kwset: New file.

7 months agoSort-of sync model bootstrap.conf from coreutils
Paul Eggert [Wed, 25 Jun 2025 02:57:18 +0000 (19:57 -0700)] 
Sort-of sync model bootstrap.conf from coreutils

* build-aux/bootstrap.conf (XGETTEXT_OPTIONS):
Sync from coreutils, providing flags for error, etc.
(gettext_external, excluded_files): Remove, as
excluded_files has not worked for a long time.
(bootstrap_post_import_hook): New function, doing
what the old excluded_files tried to do.

7 months agoFix typo in comment.
Bruno Haible [Mon, 23 Jun 2025 20:31:02 +0000 (22:31 +0200)] 
Fix typo in comment.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Fix typo in comment.

7 months agoautoupdate
Karl Berry [Mon, 23 Jun 2025 15:00:12 +0000 (08:00 -0700)] 
autoupdate

7 months agogcd: Improve comments regarding GCD_WORD_T.
Bruno Haible [Mon, 23 Jun 2025 02:20:45 +0000 (04:20 +0200)] 
gcd: Improve comments regarding GCD_WORD_T.

* lib/gcd.h: Fix typo in last commit.

7 months agogcd: Improve comments regarding GCD_WORD_T.
Bruno Haible [Mon, 23 Jun 2025 02:16:16 +0000 (04:16 +0200)] 
gcd: Improve comments regarding GCD_WORD_T.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-06/msg00243.html>.

* lib/gcd.h (GCD_WORD_T): Improve comments.

7 months agogcd: Allow customizing the parameter and result type.
Bruno Haible [Sun, 22 Jun 2025 20:12:23 +0000 (22:12 +0200)] 
gcd: Allow customizing the parameter and result type.

* lib/gcd.h (GCD_WORD_T): New type.
(gcd): Use GCD_WORD_T instead of 'unsigned long'.
* lib/gcd.c (WORD_T): Likewise.

7 months agoautoupdate
Karl Berry [Fri, 20 Jun 2025 15:59:08 +0000 (08:59 -0700)] 
autoupdate

7 months agoautoupdate
Karl Berry [Thu, 19 Jun 2025 13:55:28 +0000 (06:55 -0700)] 
autoupdate

7 months agostring-desc: Fix a compiler warning.
Bruno Haible [Wed, 18 Jun 2025 23:26:45 +0000 (01:26 +0200)] 
string-desc: Fix a compiler warning.

* lib/string-desc.h (sd_overwrite): Remove 'return' keyword.

7 months agoboot-time: comment that it's for container not host
Paul Eggert [Tue, 17 Jun 2025 16:53:58 +0000 (09:53 -0700)] 
boot-time: comment that it's for container not host

Comment that in Docker etc., get_boot_time returns the
boot time of the container, not of its host.
Also, give an example file instead of saying just “FILE”.

7 months agolistxattr: document Linux 6.15 bug
Paul Eggert [Tue, 17 Jun 2025 16:11:49 +0000 (09:11 -0700)] 
listxattr: document Linux 6.15 bug

This bug should be fixed in Linux kernel 6.16; see:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fe78e02600f83d81e55f6fc352d82c4f264a2901
For what it's worth, Coreutils decided not to work around the bug,
and instead to suggest updating to a fixed kernel or to a future
version of libattr with at least the following patches:
https://cgit.git.savannah.gnu.org/cgit/attr.git/commit/?id=58abfe6eba0d8d58a61ee8bee0615f74d393fff2
https://cgit.git.savannah.gnu.org/cgit/attr.git/commit/?id=504ab19d7b032212755ab3c7df16be98d5b5212e

7 months agognulib-tool: Default to --single-configure. New option --two-configures.
Bruno Haible [Mon, 16 Jun 2025 09:15:01 +0000 (11:15 +0200)] 
gnulib-tool: Default to --single-configure. New option --two-configures.

* gnulib-tool.sh: single_configure now defaults to false. New option
--two-configures. Stop documenting option --single-configure.
* pygnulib/GLInfo.py (GLInfo.usage): Document option --two-configures.
Stop documenting option --single-configure.
* pygnulib/GLTestDir.py (GLTestDir.execute): Update comment.
* pygnulib/main.py (main): single_configure now defaults to false.
New option --two-configures.
* doc/transversal.texi: Update.
* HACKING: Update.

7 months agofenv-environment tests: Fix compilation errors on Linux/sh4.
Bruno Haible [Sun, 15 Jun 2025 15:25:22 +0000 (17:25 +0200)] 
fenv-environment tests: Fix compilation errors on Linux/sh4.

Reported by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-06/msg00124.html>.

* tests/test-fenv-env-2.c (FE_UPWARD, FE_DOWNWARD): Define as aliases.
* tests/test-fenv-env-3.c: Likewise.
* tests/test-fenv-env-4.c: Likewise.
* tests/test-fenv-env-5.c: Likewise.

7 months agolibgmp-mpz: require Baillie-PSW primality test
Paul Eggert [Sun, 15 Jun 2025 05:45:48 +0000 (22:45 -0700)] 
libgmp-mpz: require Baillie-PSW primality test

* m4/libgmp.m4 (gl_LIBGMP): Reject GMP 6.1.2 (2016) and earlier,
as these older versions had an inferior primality test and
coreutils factor.c will need Baillie-PSW.  mini-gmp.c already has
Baillie-PSW, so it can serve as a fallback.

7 months agostat: Support the file name "/dev/null" on native Windows.
Bruno Haible [Fri, 13 Jun 2025 10:27:44 +0000 (12:27 +0200)] 
stat: Support the file name "/dev/null" on native Windows.

Reported by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-06/msg00119.html>.

* lib/stat.c (rpl_stat): On native Windows, map "/dev/null" to "NUL".
* tests/test-fstat.c (main): Test /dev/null also on native Windows.
* tests/test-stat.h (test_stat_func): Likewise.
* tests/test-lstat.h (test_lstat_func): Likewise.
* doc/posix-functions/stat.texi: Mention problem of null device name.
* doc/posix-functions/lstat.texi: Likewise.

7 months agolstat tests: Avoid test failure on Solaris.
Bruno Haible [Fri, 13 Jun 2025 01:58:46 +0000 (03:58 +0200)] 
lstat tests: Avoid test failure on Solaris.

* tests/test-lstat.h (test_lstat_func): Reduce assumption about
/dev/null on Solaris.

7 months agostat, lstat, fstat tests: Enhance tests regarding /dev/null or NUL.
Bruno Haible [Thu, 12 Jun 2025 17:45:19 +0000 (19:45 +0200)] 
stat, lstat, fstat tests: Enhance tests regarding /dev/null or NUL.

* tests/test-fstat.c: Include <fcntl.h>.
(main): Check that fstat reports /dev/null or NUL as a character device.
* tests/test-stat.h (test_stat_func): Likewise for stat.
* tests/test-lstat.h (test_lstat_func): Likewise for lstat.

7 months agostat: Document mingw bug.
Bruno Haible [Thu, 12 Jun 2025 22:02:57 +0000 (00:02 +0200)] 
stat: Document mingw bug.

* doc/posix-functions/stat.texi: Mention the bug with NUL on mingw.

7 months agostat: Add support for mingw 13 in 32-bit mode.
Bruno Haible [Thu, 12 Jun 2025 22:04:32 +0000 (00:04 +0200)] 
stat: Add support for mingw 13 in 32-bit mode.

* lib/sys_stat.in.h (_stat32i64): Redirect to rpl_stat.

7 months agodcomp-script: Reject D compilers with installation problems.
Bruno Haible [Thu, 12 Jun 2025 17:16:28 +0000 (19:16 +0200)] 
dcomp-script: Reject D compilers with installation problems.

* m4/dcomp.m4 (gt_DCOMP): Try each candidate program, seeing whether it
can compile a trivial program.
* build-aux/dcomp.sh.in: Fix typos in comment.

7 months agogettext: Improve config.log traces.
Bruno Haible [Thu, 12 Jun 2025 17:09:46 +0000 (19:09 +0200)] 
gettext: Improve config.log traces.

* m4/progtest.m4 (AM_PATH_PROG_WITH_TEST): Emit the configure line
number into config.log.

7 months agofenv*: Fix compilation error with mingw 13.
Bruno Haible [Wed, 11 Jun 2025 12:43:04 +0000 (14:43 +0200)] 
fenv*: Fix compilation error with mingw 13.

It's caused by an ABI change in mingw:
<https://sourceforge.net/p/mingw-w64/mingw-w64/ci/5c5973cf5f021db8fd75e9667e63881ccd169320/>.

Reported by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-04/msg00215.html>.

* m4/fenv-environment.m4 (gl_FENV_ENVIRONMENT): Update comments for
mingw 13.
* lib/fenv-private.h (exceptions_to_x86hardware,
x86hardware_to_exceptions): On mingw >= 13, define these like on MSVC.
* lib/fenv-round.c (fegetround, fesetround): Do the safe mapping also on
mingw >= 13.
* lib/fenv-except-state-set.c (fesetexceptflag): Do the
exceptions_to_x86hardware conversion also on other platforms than MSVC.
* lib/fenv-except-tracking-clear.c (feclearexcept): Likewise.
* lib/fenv-except-tracking-set.c (fesetexcept): Likewise.
* lib/fenv-except-trapping.c (feenableexcept, fedisableexcept,
fegetexcept): Do the exceptions_to_x86hardware and
x86hardware_to_exceptions conversions also on other platforms than MSVC.
* lib/fenv-env.c (fegetenv, fesetenv): Add new implementation for
mingw >= 13.
* doc/posix-functions/fesetenv.texi: Mention the new mingw bug.
* doc/posix-functions/feupdateenv.texi: Mention the new mingw bug.

8 months agoSilence 'time-stamp' warnings with bleeding-edge Emacs.
Collin Funk [Tue, 10 Jun 2025 02:50:35 +0000 (19:50 -0700)] 
Silence 'time-stamp' warnings with bleeding-edge Emacs.

* build-aux/announce-gen: Use "%Y" instead of "%:y" for the
'time-stamp-format' local variable.
* build-aux/do-release-commit-and-tag: Likewise.
* build-aux/gendocs.sh: Likewise.
* build-aux/git-version-gen: Likewise.
* build-aux/gitlog-to-changelog: Likewise.
* build-aux/gnu-web-doc-update: Likewise.
* build-aux/gnupload: Likewise.
* build-aux/move-if-change: Likewise.
* build-aux/prefix-gnulib-mk: Likewise.
* build-aux/update-copyright: Likewise.
* build-aux/useless-if-before-free: Likewise.
* build-aux/vc-list-files: Likewise.
* top/bootstrap: Likewise.
* top/bootstrap-funclib.sh: Likewise.
* build-aux/bootstrap: Regenerate.

8 months agofile-has-acl tests: Avoid test failure on Cygwin.
Bruno Haible [Mon, 9 Jun 2025 10:51:14 +0000 (12:51 +0200)] 
file-has-acl tests: Avoid test failure on Cygwin.

* modules/file-has-acl-tests (Makefile.am): Add host_os to the
TESTS_ENVIRONMENT.
* tests/test-file-has-acl-2.sh: On Cygwin, skip this test.

8 months agoparse-datetime: debug mktime failures better
Paul Eggert [Mon, 9 Jun 2025 06:51:25 +0000 (23:51 -0700)] 
parse-datetime: debug mktime failures better

* lib/parse-datetime.y (debug_mktime_not_ok):
Handle mktime failures too.
Don’t pretend that the time was normalized if mktime failed.
Don’t attempt to deduce DST shifts; it’s impractical in general
and even a reasonable heuristic is too painful.

8 months agostdcountof-h: Work around a clang bug.
Bruno Haible [Sun, 8 Jun 2025 00:58:21 +0000 (02:58 +0200)] 
stdcountof-h: Work around a clang bug.

Reported by Basil L. Contovounesios <basil@contovou.net> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-06/msg00073.html>.

* lib/stdcountof.in.h (_gl_verify_is_array): Disable the checking on
clang.
* tests/test-stdcountof-h.c (test_func): Add another test case.

8 months agodoc: Add some missing Makefile targets.
Collin Funk [Sat, 7 Jun 2025 03:52:07 +0000 (20:52 -0700)] 
doc: Add some missing Makefile targets.

* doc/Makefile (standards.pdf, maintain.info, maintain.html)
(maintain.dvi, maintain.pdf): New targets.
* doc/.gitignore: Add files generated when building GNU Maintainer
Information and GNU Standards.

8 months agoautoupdate
Karl Berry [Fri, 6 Jun 2025 14:58:19 +0000 (07:58 -0700)] 
autoupdate

8 months agoregex: fix resource leak when searching (ChangeLog entry)
Paul Eggert [Fri, 6 Jun 2025 06:35:33 +0000 (23:35 -0700)] 
regex: fix resource leak when searching (ChangeLog entry)

8 months agoregex: fix resource leak when searching
Alec Brown [Wed, 4 Jun 2025 20:49:15 +0000 (20:49 +0000)] 
regex: fix resource leak when searching

* lib/regex.c (merge_state_with_log):
In this function, memory is allocated for the variable next_nodes when
creating a union of the variables table_nodes and log_nodes.
However, if next_state->entrance_nodes is NULL, table_nodes becomes
NULL and we still allocate memory to copy the contents of log_nodes.
This can cause a resource leak since we only free the memory for
next_nodes if table_nodes isn't NULL. To prevent this, check that
next_state->entrance_nodes isn't NULL before allocating memory
for the union.

This issue was found by a Coverity Scan of GRUB2 under the following CID:
CID: 473887

Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Copyright-paperwork-exempt: Yes

8 months agoregex: fix some leaks when pattern compilation fails
Paul Eggert [Fri, 6 Jun 2025 01:52:33 +0000 (18:52 -0700)] 
regex: fix some leaks when pattern compilation fails

Problem reported by Alec Brown in:
https://lists.gnu.org/r/bug-gnulib/2025-06/msg00040.html
* lib/regcomp.c (create_initial_state, calc_eclosure_iter):
Fix some memory leaks when these functions fail.

8 months agounictype/base, uninorm/base, etc.: Support shared libraries on MSVC.
Bruno Haible [Thu, 5 Jun 2025 11:53:04 +0000 (13:53 +0200)] 
unictype/base, uninorm/base, etc.: Support shared libraries on MSVC.

* m4/libunistring-base.m4 (gl_LIBUNISTRING_MODULE_WITH_VARIABLE): Use
the value of
${module_indicator_prefix}_GNULIB_LIBUNISTRING_DLL_VARIABLE_NAME.

8 months agotest-xfail: Relicense more permissively.
Bruno Haible [Wed, 4 Jun 2025 21:30:10 +0000 (23:30 +0200)] 
test-xfail: Relicense more permissively.

* modules/test-xfail (License): Change to 'GPLed build tool'.

8 months agofcntl-h: Fix configure test on MSVC.
Bruno Haible [Tue, 3 Jun 2025 21:28:11 +0000 (23:28 +0200)] 
fcntl-h: Fix configure test on MSVC.

* m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Reshuffle the exit code assignments
again, so that a compilation failure produces the "no" result both on
mingw and on MSVC. Fix typo in the test program.

8 months agosetlocale: Update a comment.
Collin Funk [Tue, 3 Jun 2025 19:55:03 +0000 (12:55 -0700)] 
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.

8 months agostdcountof-h tests: Fix compilation error with gcc versions < 15.
Bruno Haible [Tue, 3 Jun 2025 12:15:39 +0000 (14:15 +0200)] 
stdcountof-h tests: Fix compilation error with gcc versions < 15.

* tests/test-stdcountof-h.c (HAVE___TYPEOF__): Remove macro.
(test_func): Remove __typeof__ invocations.

8 months agofcntl-h, open: Fix two regressions on native Windows (regr. 2025-05-26).
Bruno Haible [Tue, 3 Jun 2025 02:59:58 +0000 (04:59 +0200)] 
fcntl-h, open: Fix two regressions on native Windows (regr. 2025-05-26).

* m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Reshuffle the exit code bits, so
that a compilation failure produces the "no" result.
* lib/open.c (open): Don't pass the O_DIRECTORY flag when doing
recursion with /dev/null.

8 months agofts: Update dependencies.
Bruno Haible [Tue, 3 Jun 2025 08:58:06 +0000 (10:58 +0200)] 
fts: Update dependencies.

* modules/fts (Depends-on): Add close, dirfd, fstatat, openat. Remove
lstat, open, opendir.

8 months agostdcountof-h: Always return size_t, in a better way.
Bruno Haible [Tue, 3 Jun 2025 09:26:45 +0000 (11:26 +0200)] 
stdcountof-h: Always return size_t, in a better way.

* lib/stdcountof.in.h: Revert last change. Include <stddef.h>
unconditionally.
(countof): Cast value to size_t.
* tests/test-stdcountof-h.c (HAVE___TYPEOF__, HAVE__GENERIC): New
macros.
(test_func): Check the return type of countof.

8 months agostdcountof-h: always return size_t
Paul Eggert [Tue, 3 Jun 2025 01:58:24 +0000 (18:58 -0700)] 
stdcountof-h: always return size_t

* lib/stdcountof.in.h (__SIZE_TYPE__): Define to size_t,
including stddef.h to get it, if not already defined.
This avoids a bit of namespace pollution.
All uses of size_t changed to use __SIZE_TYPE__.
(countof): Return size_t, even if size_t is narrower than int (!).
While we’re at it, simplify ‘sizeof ((a)[0])’ to ‘sizeof *(a)’
as it’s simpler and later code uses the ‘*(a)’ notation already.

8 months agostdcountof-h: Tweaks.
Bruno Haible [Mon, 2 Jun 2025 22:48:06 +0000 (00:48 +0200)] 
stdcountof-h: Tweaks.

Reported by Alejandro Colomar <alx@kernel.org>.

* lib/stdcountof.in.h (countof): Parenthesize better.
* modules/stdcountof-h (Description): To appear in C2y, not C23.

8 months agostdcountof-h: Add tests.
Bruno Haible [Mon, 2 Jun 2025 21:44:55 +0000 (23:44 +0200)] 
stdcountof-h: Add tests.

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

8 months agostdcountof-h: New module.
Bruno Haible [Mon, 2 Jun 2025 21:42:17 +0000 (23:42 +0200)] 
stdcountof-h: New module.

* lib/stdcountof.in.h: New file.
* m4/stdcountof_h.m4: New file.
* modules/stdcountof-h: New file.

8 months agostddef-h: Fix compilation errors in C++ mode (regression 2025-05-27).
Bruno Haible [Mon, 2 Jun 2025 16:32:26 +0000 (18:32 +0200)] 
stddef-h: Fix compilation errors in C++ mode (regression 2025-05-27).

* m4/stddef_h.m4 (gl_STDDEF_H): Set and substitute HAVE_C_UNREACHABLE.
Don't test for unreachable in <stddef.h> in C++. Set
GL_GENERATE_STDDEF_H to true always.
* lib/stddef.in.h (gl_unreachable): Renamed from _gl_unreachable. Test
HAVE_C_UNREACHABLE.
(unreachable): Don't define in C++ mode. Don't define if
HAVE_C_UNREACHABLE is 1.
* modules/stddef-h (Makefile.am): Substitute HAVE_C_UNREACHABLE.
* tests/test-stddef-h.c (test_unreachable_optimization,
test_unreachable_noreturn): Don't define in C++ mode.
(test_gl_unreachable_optimization, test_gl_unreachable_noreturn): New
functions.
* tests/test-stddef-h-c++3.cc (test_cxx_unreachable_1): Test
gl_unreachable instead of unreachable.
* lib/error.in.h (__gl_error_call1): Use gl_unreachable instead of
unreachable.

8 months agoautoupdate
Karl Berry [Mon, 2 Jun 2025 15:01:09 +0000 (08:01 -0700)] 
autoupdate

8 months agoopen, openat: Fix test failure on native Windows.
Bruno Haible [Mon, 2 Jun 2025 10:51:55 +0000 (12:51 +0200)] 
open, openat: Fix test failure on native Windows.

* tests/test-open.h (test_open): Expect a different error code for
"/dev/null/" on native Windows.

8 months agoopen: Fix syntax error on native Windows (regression 2025-05-28).
Bruno Haible [Mon, 2 Jun 2025 10:50:04 +0000 (12:50 +0200)] 
open: Fix syntax error on native Windows (regression 2025-05-28).

* lib/open.c (open): Add missing parenthesis.

8 months agogettext-h: Avoid warnings from "gcc -Wextra".
Bruno Haible [Sun, 1 Jun 2025 09:40:11 +0000 (11:40 +0200)] 
gettext-h: Avoid warnings from "gcc -Wextra".

Reported by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00280.html>.

* lib/gettext.h (gettext, dgettext, dcgettext): Silence
-Wbuiltin-declaration-mismatch warning.

8 months agoFix recent ChangeLog entry.
Bruno Haible [Sat, 31 May 2025 23:24:47 +0000 (01:24 +0200)] 
Fix recent ChangeLog entry.

8 months agostat-time tests: Add C++ tests.
Bruno Haible [Sat, 31 May 2025 21:43:24 +0000 (23:43 +0200)] 
stat-time tests: Add C++ tests.

* tests/test-stat-time-c++.cc: New file.
* modules/stat-time-c++-tests: New file.
* modules/stat-time-tests (Depends-on): Add stat-time-c++-tests.

8 months agostat-time: Fix syntax errors in C++ mode on MSVC (regr. 2023-05-14).
Bruno Haible [Sat, 31 May 2025 23:07:53 +0000 (01:07 +0200)] 
stat-time: Fix syntax errors in C++ mode on MSVC (regr. 2023-05-14).

* lib/stat-time.h (_gl_make_timespec): New macro / function.
(get_stat_atime, get_stat_ctime, get_stat_mtime, get_stat_birthtime):
Use it instead of a compound literal expression.

8 months agogettext-h: Fix compilation error on Solaris 11 (regr. 2025-05-28).
Bruno Haible [Sat, 31 May 2025 23:10:06 +0000 (01:10 +0200)] 
gettext-h: Fix compilation error on Solaris 11 (regr. 2025-05-28).

* lib/gettext.h (gettext, dgettext, dcgettext): On Solaris, use 'char *'
as return type.

8 months agoMake gl_CHECK_FUNCS_MACOS work with current unreleased Autoconf.
Bruno Haible [Sat, 31 May 2025 21:17:26 +0000 (23:17 +0200)] 
Make gl_CHECK_FUNCS_MACOS work with current unreleased Autoconf.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-autoconf/2025-05/msg00024.html>.

* m4/gnulib-common.m4 (gl_CHECK_FUNCS_CASE_FOR_MACOS): Temporarily set
ac_c_future_darwin_options, ac_cxx_future_darwin_options to empty for
the second AC_CHECK_DECL invocation.

8 months agolistxattr: document Linux 6.14- bug
Paul Eggert [Fri, 30 May 2025 17:28:06 +0000 (10:28 -0700)] 
listxattr: document Linux 6.14- bug

This bug is fixed in Linux kernel 6.15; see:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8b0ba61d
For what it's worth, Coreutils decided not to work around the bug,
and instead to suggest updating to a fixed kernel.

8 months agoDocument O_CREAT|O_DIRECTORY bugs with Linux <6.4
Paul Eggert [Fri, 30 May 2025 07:41:32 +0000 (00:41 -0700)] 
Document O_CREAT|O_DIRECTORY bugs with Linux <6.4

8 months agofcntl-safer-tests: also update this for fifos
Paul Eggert [Wed, 28 May 2025 19:31:45 +0000 (12:31 -0700)] 
fcntl-safer-tests: also update this for fifos

* modules/fcntl-safer-tests (Depends-on): Add mkfifo.
(configure.ac) Check for alarm decl.
* tests/test-fcntl-safer.c:
Include sys/stat.h, for mkfifo.
[HAVE_DECL_ALARM]: Include signal.h, for alarm.

8 months agoopen, openat: handle O_DIRECTORY on special files
Paul Eggert [Wed, 28 May 2025 17:40:21 +0000 (10:40 -0700)] 
open, openat: handle O_DIRECTORY on special files

On deficient platforms where we must check for directories
ourselves when opening files, check before opening as well as after.
This prevents a hang when trying to open a special file like a
fifo in a context where a directory is required.  Although there
is still a race so we could still hang in a perverse situation,
it’s the best we can do and it is better than hanging in the
more-common case.
* lib/open.c (lstatif): New static function.
(open) [REPLACE_FCHDIR]: Also inspect O_CREAT.
* lib/open.c (open), lib/openat.c (rpl_openat):
When checking for directories, also do this before opening.
Also, respect O_NOFOLLOW when checking for directories.
* lib/openat.c: Remove a few more unnecessary differences from open.c.
* modules/open (Depends-on): Depend on lstat.
* modules/openat (Depends-on): Add fstatat.
* modules/open-tests, modules/openat-tests:
(configure.ac) Check for alarm decl.
* tests/test-open.c, tests/test-openat.c:
Include sys/stat.h, for mkfifo.
[HAVE_DECL_ALARM]: Include signal.h, for alarm.
* tests/test-open.h (test_open): Fail if test takes too long
because we tried to open a fifo.  Test opening /dev/null,
/dev/tty and a fifo, with a trailing "/" and with O_DIRECTORY.

8 months agovasnprintf: Fix uninitialized values.
Collin Funk [Wed, 28 May 2025 14:50:33 +0000 (07:50 -0700)] 
vasnprintf: Fix uninitialized values.

* lib/vasnprintf.c (VASNPRINFT): Initialize all occurrences of
thousep_len to zero.

8 months agogettext-h: Avoid gcc -Wformat-security warnings with --disable-nls.
Bruno Haible [Wed, 28 May 2025 13:14:07 +0000 (15:14 +0200)] 
gettext-h: Avoid gcc -Wformat-security warnings with --disable-nls.

Reported by Holger Hoffstätte <holger@applied-asynchrony.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00225.html>.

* lib/gettext.h (gettext, dgettext, dcgettext): With gcc in C mode,
define these as inline functions.
* lib/sigpipe-die.c (sigpipe_die): Use translated string as a format
string, relying on the format string checking done by 'msgfmt -c'.
* lib/xmemcoll.c (collate_error): Revert commit from 2025-01-17.
* lib/xprintf.c (xvprintf, xvfprintf): Likewise.
* lib/openat-die.c (openat_save_fail, openat_restore_fail): Revert
commit from 2024-12-10.

8 months agostddef-h: Make 'unreachable' usable in C++ mode.
Bruno Haible [Tue, 27 May 2025 23:59:05 +0000 (01:59 +0200)] 
stddef-h: Make 'unreachable' usable in C++ mode.

Reported by Pierre Ossman <ossman@cendio.se>
at <https://savannah.gnu.org/bugs/?67152>.

* m4/stddef_h.m4 (gl_STDDEF_H): Also test whether unreachable is defined
by <stddef.h> in C++ mode.
* lib/stddef.in.h: In C++ mode, include <utility> and either import
'unreachable' from the std namespace or define it as an inline function.
* tests/test-stddef-h.c: Disable some tests in C++ mode.
* tests/test-stddef-h-c++.cc: Perform nearly the same tests in C++ mode
as in C mode.
* tests/test-stddef-h-c++2.cc: Rename some variables. Disable the NULL
test with clang on Windows.
* tests/test-stddef-h-c++3.cc: New file.
* modules/stddef-h-c++-tests (Files): Include it.
(Makefile.am): Link test-stddef-h-c++ with test-stddef-h-c++3.o.

8 months agostrchrnul: Fix for users of the current macOS SDK.
Bruno Haible [Tue, 27 May 2025 14:11:49 +0000 (16:11 +0200)] 
strchrnul: Fix for users of the current macOS SDK.

Reported in <https://savannah.gnu.org/bugs/?67141>.

* m4/strchrnul.m4 (gl_FUNC_STRCHRNUL): Use gl_CHECK_FUNCS_ANDROID_MACOS
instead of gl_CHECK_FUNCS_ANDROID.

8 months agodoc: Update platforms list re *_CLOFORK.
Bruno Haible [Tue, 27 May 2025 09:33:00 +0000 (11:33 +0200)] 
doc: Update platforms list re *_CLOFORK.

* doc/posix-headers/fcntl.texi: Update platforms list.

8 months agofcntl-h: Update platforms list re O_DIRECTORY.
Bruno Haible [Tue, 27 May 2025 09:24:45 +0000 (11:24 +0200)] 
fcntl-h: Update platforms list re O_DIRECTORY.

* doc/posix-headers/fcntl.texi: Update platforms list.
* doc/posix-functions/open.texi: Likewise.
* doc/posix-functions/openat.texi: Likewise.
* m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Guess that O_DIRECTORY works for
Mac OS X >= 10.5. Use prefix 'gl_', not 'ac_', for our variables.

8 months agodoc: Style module name.
Bruno Haible [Tue, 27 May 2025 08:29:31 +0000 (10:29 +0200)] 
doc: Style module name.

* doc/posix-headers/fcntl.texi: Style module name with @code.

8 months agofcntl-h: document O_CLOFORK etc
Paul Eggert [Tue, 27 May 2025 02:24:27 +0000 (19:24 -0700)] 
fcntl-h: document O_CLOFORK etc

8 months agofcntl-h: support O_DIRECTORY
Paul Eggert [Tue, 27 May 2025 01:30:18 +0000 (18:30 -0700)] 
fcntl-h: support O_DIRECTORY

It is relatively easy to support O_DIRECTORY on platforms that
lack it, so let’s do that instead of having to work around bugs
like <https://bugs.gnu.org/78509#95>.
* lib/fcntl.in.h (O_DIRECTORY): Default to 0x20000000 not 0,
since Gnulib now supports it.
* lib/open.c, lib/openat.c (OPEN_TRAILING_SLASH_BUG):
Default to false, so that this can be used outside #if.
(open, openat): Add support for O_DIRECTORY on platforms that lack it.
If fstat fails, fail instead of assuming the file is a directory,
since failure can occur due to EOVERFLOW, etc.
Rearrange code to minimize differences between open.c and openat.c.
* m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Also test O_DIRECTORY,
and define HAVE_WORKING_O_DIRECTORY if needed.
Prefer AS_CASE for Emacs’s benefit.
* m4/open.m4 (gl_FUNC_OPEN):
* m4/openat.m4 (gl_FUNC_OPENAT):
Require gl_FCNTL_O_FLAGS and replace the function
if O_DIRECTORY does not work.
* tests/test-open.h: Test O_DIRECTORY.

8 months agoDocument HAVE_WORKING_O_NO{ATIME,FOLLOW}
Paul Eggert [Mon, 26 May 2025 22:41:51 +0000 (15:41 -0700)] 
Document HAVE_WORKING_O_NO{ATIME,FOLLOW}

8 months agocrypto/gc: Simplify the previous change.
Collin Funk [Mon, 26 May 2025 19:56:22 +0000 (12:56 -0700)] 
crypto/gc: Simplify the previous change.

Suggested by Bruno Haible in:
<https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00249.html>.

* lib/gc-gnulib.c (gc_cipher_setkey, gc_cipher_setiv): Remove cast and
perform a bitwise AND with an unsigned constant.

8 months agocrypto/gc: Pacify -Wformat warnings.
Collin Funk [Mon, 26 May 2025 18:27:34 +0000 (11:27 -0700)] 
crypto/gc: Pacify -Wformat warnings.

* lib/gc-gnulib.c (gc_cipher_setkey, gc_cipher_setiv): Cast the argument
since "%02x" expects the argument to be unsigned.

8 months agognulib-tool: Remove build-aux/test-driver.orig from testdirs.
Bruno Haible [Mon, 26 May 2025 08:25:10 +0000 (10:25 +0200)] 
gnulib-tool: Remove build-aux/test-driver.orig from testdirs.

* gnulib-tool.sh (func_create_testdir): Remove file
build-aux/test-driver.orig at the end.
* pygnulib/GLTestDir.py (_patch_test_driver): Likewise.

8 months agostddef-h tests: Add more C++ tests.
Bruno Haible [Sun, 25 May 2025 19:50:12 +0000 (21:50 +0200)] 
stddef-h tests: Add more C++ tests.

* tests/test-stddef-h-c++2.cc: Test the expected contents of <cstddef>.

8 months agoselinux-h: Fix error with MSVC.
Bruno Haible [Sun, 25 May 2025 19:21:32 +0000 (21:21 +0200)] 
selinux-h: Fix error with MSVC.

* lib/se-selinux.in.h: Add comment.
* modules/selinux-h (Depends-on): Add sys_types-h.

8 months agofcntl-h, unistd-h: Fix errors in C++ mode with MSVC.
Bruno Haible [Sun, 25 May 2025 19:00:49 +0000 (21:00 +0200)] 
fcntl-h, unistd-h: Fix errors in C++ mode with MSVC.

* lib/fcntl.in.h (open): Use _GL_CXXALIAS_MDA_CAST instead of
_GL_CXXALIAS_MDA.
* lib/unistd.in.h: Include <io.h>, <direct.h> before <fcntl.h>.

8 months agoutime-h: Fix error in C++ mode with MSVC.
Bruno Haible [Sun, 25 May 2025 17:11:52 +0000 (19:11 +0200)] 
utime-h: Fix error in C++ mode with MSVC.

* lib/utime.in.h (utime): Use _GL_CXXALIAS_MDA_CAST instead of
_GL_CXXALIAS_MDA.

8 months agostdckdint-h: Don't generate header if it is not needed.
Collin Funk [Fri, 23 May 2025 02:33:05 +0000 (19:33 -0700)] 
stdckdint-h: Don't generate header if it is not needed.

Suggested by Paul Eggert in:
<https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00216.html>.

* m4/stdckdint_h.m4: New file.
* modules/stdckdint-h (Files): Add m4/stdckdint_h.m4.
(configure.ac): Remove checks and just invoke gl_STDCKDINT_H.
(Makefile.am): Replace variables set by ./configure.
* lib/stdckdint.in.h: Include the compilers header if it exists.  Add
comment mentioning expected future standardization in C++26.
(ckd_add, ckd_sub, ckd_mul): Only define if the compilers definitions do
not work.

8 months agostrchrnul: Update doc.
Bruno Haible [Thu, 22 May 2025 11:09:57 +0000 (13:09 +0200)] 
strchrnul: Update doc.

* doc/glibc-functions/strchrnul.texi: strchrnul got added in macOS 15.4.

8 months agoautoupdate
Karl Berry [Wed, 21 May 2025 14:48:54 +0000 (07:48 -0700)] 
autoupdate

8 months agostdckdint-h: Work around missing declarations with g++ 15.0.
Collin Funk [Tue, 20 May 2025 04:29:03 +0000 (21:29 -0700)] 
stdckdint-h: Work around missing declarations with g++ 15.0.

* modules/stdckdint-h (configure.ac): Generate the header if the system
has one and C++ is being used.

8 months agostdckdint-h C++ tests: Verify the ckd_* functions can be invoked.
Collin Funk [Tue, 20 May 2025 04:23:56 +0000 (21:23 -0700)] 
stdckdint-h C++ tests: Verify the ckd_* functions can be invoked.

* tests/test-stdckdint-h-c++.cc (main): Invoke ckd_add, ckd_sub, and
ckd_mul.

8 months agotests: simplify test_exit_status decl
Paul Eggert [Mon, 19 May 2025 06:16:15 +0000 (23:16 -0700)] 
tests: simplify test_exit_status decl

* tests/macros.h (test_exit_status) [!NO_MAIN_HERE]:
Declare test_exit_status too, as this is simpler
and we might as well check definition vs declaration.

8 months agoFix misspelling of ‘or1k’ in doc
Paul Eggert [Mon, 19 May 2025 05:39:06 +0000 (22:39 -0700)] 
Fix misspelling of ‘or1k’ in doc

8 months agounigbrk/u*-grapheme-prev: Support Indic, Emojis, regional indicators.
Bruno Haible [Mon, 19 May 2025 00:01:32 +0000 (02:01 +0200)] 
unigbrk/u*-grapheme-prev: Support Indic, Emojis, regional indicators.

Reported by Kang-Che Sung <explorer09@gmail.com> in
<https://lists.gnu.org/archive/html/bug-libunistring/2025-03/msg00000.html>.

* lib/unigbrk/u-grapheme-prev.h: New file, based on
lib/unigbrk/u-grapheme-breaks.h.
* lib/unigbrk/u8-grapheme-prev.c: Include unictype.h and
u-grapheme-prev.h.
(u8_grapheme_prev): Remove function.
* lib/unigbrk/u16-grapheme-prev.c: Include unictype.h and
u-grapheme-prev.h.
(u16_grapheme_prev): Remove function.
* lib/unigbrk/u32-grapheme-prev.c: Include unictype.h and
u-grapheme-prev.h.
(u32_grapheme_prev): Remove function.
* modules/unigbrk/u8-grapheme-prev (Files): Add
lib/unigbrk/u-grapheme-prev.h.
(Depends-on): Remove unigbrk/uc-is-grapheme-break. Add unigbrk/base,
unigbrk/uc-gbrk-prop, unictype/incb-of,
unictype/property-extended-pictographic, bool.
(configure.ac): Bump required libunistring version.
* modules/unigbrk/u16-grapheme-prev (Files): Add
lib/unigbrk/u-grapheme-prev.h.
(Depends-on): Remove unigbrk/uc-is-grapheme-break. Add unigbrk/base,
unigbrk/uc-gbrk-prop, unictype/incb-of,
unictype/property-extended-pictographic, bool.
(configure.ac): Bump required libunistring version.
* modules/unigbrk/u32-grapheme-prev (Files): Add
lib/unigbrk/u-grapheme-prev.h.
(Depends-on): Remove unigbrk/uc-is-grapheme-break. Add unigbrk/base,
unigbrk/uc-gbrk-prop, unictype/incb-of,
unictype/property-extended-pictographic, bool.
(configure.ac): Bump required libunistring version.
* tests/unigbrk/test-u8-grapheme-prev.c (main): Add more test cases,
from tests/unigbrk/test-u8-grapheme-breaks.c.
* tests/unigbrk/test-u16-grapheme-prev.c (main): Add more test cases,
from tests/unigbrk/test-u16-grapheme-breaks.c.
* tests/unigbrk/test-u32-grapheme-prev.c (main): Add more test cases,
from tests/unigbrk/test-u32-grapheme-breaks.c.

8 months agounigbrk/u*-grapheme-next: Support Indic, Emojis, regional indicators.
Bruno Haible [Sun, 18 May 2025 23:53:23 +0000 (01:53 +0200)] 
unigbrk/u*-grapheme-next: Support Indic, Emojis, regional indicators.

Reported by Kang-Che Sung <explorer09@gmail.com> in
<https://lists.gnu.org/archive/html/bug-libunistring/2025-03/msg00000.html>
and by Lich <author@lch361.net> in
<https://lists.gnu.org/archive/html/bug-libunistring/2025-05/msg00000.html>.

* lib/unigbrk/u-grapheme-next.h: New file, based on
lib/unigbrk/u-grapheme-breaks.h.
* lib/unigbrk/u8-grapheme-next.c: Include unictype.h and
u-grapheme-next.h.
(u8_grapheme_next): Remove function.
* lib/unigbrk/u16-grapheme-next.c: Include unictype.h and
u-grapheme-next.h.
(u16_grapheme_next): Remove function.
* lib/unigbrk/u32-grapheme-next.c: Include unictype.h and
u-grapheme-next.h.
(u32_grapheme_next): Remove function.
* modules/unigbrk/u8-grapheme-next (Files): Add
lib/unigbrk/u-grapheme-next.h.
(Depends-on): Remove unigbrk/uc-is-grapheme-break. Add unigbrk/base,
unigbrk/uc-gbrk-prop, unictype/incb-of,
unictype/property-extended-pictographic, bool.
(configure.ac): Bump required libunistring version.
* modules/unigbrk/u16-grapheme-next (Files): Add
lib/unigbrk/u-grapheme-next.h.
(Depends-on): Remove unigbrk/uc-is-grapheme-break. Add unigbrk/base,
unigbrk/uc-gbrk-prop, unictype/incb-of,
unictype/property-extended-pictographic, bool.
(configure.ac): Bump required libunistring version.
* modules/unigbrk/u32-grapheme-next (Files): Add
lib/unigbrk/u-grapheme-next.h.
(Depends-on): Remove unigbrk/uc-is-grapheme-break. Add unigbrk/base,
unigbrk/uc-gbrk-prop, unictype/incb-of,
unictype/property-extended-pictographic, bool.
(configure.ac): Bump required libunistring version.
* tests/unigbrk/test-u8-grapheme-next.c (main): Add more test cases,
from tests/unigbrk/test-u8-grapheme-breaks.c.
* tests/unigbrk/test-u16-grapheme-next.c (main): Add more test cases,
from tests/unigbrk/test-u16-grapheme-breaks.c.
* tests/unigbrk/test-u32-grapheme-next.c (main): Add more test cases,
from tests/unigbrk/test-u32-grapheme-breaks.c.

8 months agounigbrk/u*-grapheme-breaks: Tiny optimization.
Bruno Haible [Sun, 18 May 2025 23:52:59 +0000 (01:52 +0200)] 
unigbrk/u*-grapheme-breaks: Tiny optimization.

* lib/unigbrk/u-grapheme-breaks.h (FUNC): Exploit the fact that n > 0.

8 months agoautoupdate
Karl Berry [Sun, 18 May 2025 14:22:27 +0000 (07:22 -0700)] 
autoupdate

8 months agocosh: Add more tests.
Bruno Haible [Sat, 17 May 2025 12:19:24 +0000 (14:19 +0200)] 
cosh: Add more tests.

* tests/test-cosh.c: Include <stdio.h>, <string.h>.
(main): Add another test case.

8 months agosinh: Add more tests.
Bruno Haible [Sat, 17 May 2025 12:18:45 +0000 (14:18 +0200)] 
sinh: Add more tests.

* tests/test-sinh.c: Include <stdio.h>, <string.h>.
(main): Add another test case.

8 months agocrypto/sha512-buffer: Add some tests.
Bruno Haible [Sat, 17 May 2025 12:17:24 +0000 (14:17 +0200)] 
crypto/sha512-buffer: Add some tests.

* tests/test-sha384-buffer.c: New file, based on
tests/test-sha1-buffer.c.
* tests/test-sha512-buffer.c: New file, based on
tests/test-sha1-buffer.c.
* modules/crypto/sha512-buffer-tests (Files): Add them.
(Makefile.am): Compile and test test-sha384-buffer, test-sha512-buffer.

8 months agocrypto/sha256-buffer: Add some tests.
Bruno Haible [Sat, 17 May 2025 12:16:01 +0000 (14:16 +0200)] 
crypto/sha256-buffer: Add some tests.

* tests/test-sha224-buffer.c: New file, based on
tests/test-sha1-buffer.c.
* tests/test-sha256-buffer.c: New file, based on
tests/test-sha1-buffer.c.
* modules/crypto/sha256-buffer-tests (Files): Add them.
(Makefile.am): Compile and test test-sha224-buffer, test-sha256-buffer.

8 months agonext-prime tests: Add more tests.
Bruno Haible [Sat, 17 May 2025 09:09:58 +0000 (11:09 +0200)] 
next-prime tests: Add more tests.

* tests/test-next-prime.c (main): Add another test case.

8 months agoclean-temp: Fix typo in comment.
Bruno Haible [Sat, 17 May 2025 09:07:20 +0000 (11:07 +0200)] 
clean-temp: Fix typo in comment.

* lib/clean-temp.h: Fix typo in comment.

8 months agoasyncsafe-spin: Fix race condition on native Windows.
Bruno Haible [Fri, 16 May 2025 14:37:03 +0000 (16:37 +0200)] 
asyncsafe-spin: Fix race condition on native Windows.

* lib/asyncsafe-spin.h (asyncsafe_spin_lock, asyncsafe_spin_unlock): Add
from_signal_handler parameter.
* lib/asyncsafe-spin.c (asyncsafe_spin_lock, asyncsafe_spin_unlock):
Likewise.
* modules/asyncsafe-spin (Depends-on): Add bool.
* tests/test-asyncsafe-spin1.c (main): Update.
* tests/test-asyncsafe-spin2.c (lock_mutator_thread,
lock_checker_thread): Update.
* lib/clean-temp-simple.c (clean_temp_asyncsafe_close): Update.
* lib/clean-temp.c (asyncsafe_fclose_variant): Update.

8 months agosigprocmask: Make multithread-safe on native Windows.
Bruno Haible [Fri, 16 May 2025 13:51:13 +0000 (15:51 +0200)] 
sigprocmask: Make multithread-safe on native Windows.

* lib/sigprocmask.c: Include glthread/lock.h.
(sig_lock): New variable.
(blocked_set): Remove 'volatile'.
(sigprocmask, _gl_raise_SIGPIPE): Use the sig_lock.
* modules/sigprocmask (Depends-on): Add lock.
* doc/posix-functions/sigprocmask.texi: Mention the async-safety issue.

8 months agopthread-rwlock tests: Add a comment.
Bruno Haible [Fri, 16 May 2025 13:09:09 +0000 (15:09 +0200)] 
pthread-rwlock tests: Add a comment.

Reported by Natanael Copa <ncopa@alpinelinux.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00164.html>.

* tests/test-pthread-rwlock.c: Explain why this test can fail.

8 months agoautoupdate
Karl Berry [Wed, 14 May 2025 15:27:00 +0000 (08:27 -0700)] 
autoupdate

8 months agoasyncsafe-spin: Rely on module 'spin'.
Bruno Haible [Wed, 14 May 2025 14:27:30 +0000 (16:27 +0200)] 
asyncsafe-spin: Rely on module 'spin'.

* lib/asyncsafe-spin.h: Include glthread/spin.h.
(asyncsafe_spinlock_t, ASYNCSAFE_SPIN_INIT): Simplify by using
gl_spinlock_t, gl_spinlock_initializer.
* lib/asyncsafe-spin.c: Simplify by using glthread_spin_* functions.
* modules/asyncsafe-spin (Files): Remove m4/atomic-cas.m4.
(Depends-on): Add spin. Remove bool, windows-spin, sparcv8+.
(configure.ac): Remove tests.