]> Savannah Git Hosting - gnulib.git/log
gnulib.git
10 months agovasnprintf, u*-asnprintf tests: Adjust memory need.
Bruno Haible [Wed, 19 Jun 2024 23:28:33 +0000 (01:28 +0200)]
vasnprintf, u*-asnprintf tests: Adjust memory need.

* tests/test-vasnprintf-big.c (main): Require 10, not 12, GiB of RAM.
* tests/unistdio/test-u8-asnprintf-big.c (main): Require 15 GiB of RAM.
* tests/unistdio/test-ulc-asnprintf-big.c (main): Likewise.

10 months agou8-asnprintf tests: Fix mistake.
Bruno Haible [Wed, 19 Jun 2024 23:27:12 +0000 (01:27 +0200)]
u8-asnprintf tests: Fix mistake.

* tests/unistdio/test-u8-asnprintf-big.c: Include <unistr.h>.
(main): Use u8_strlen instead of strlen.
* modules/unistdio/u8-asnprintf-extra-tests (Depends-on): Add
unistr/u8-strlen.

10 months agofilemode tests: Fix comment.
Collin Funk [Wed, 19 Jun 2024 21:52:49 +0000 (14:52 -0700)]
filemode tests: Fix comment.

* tests/test-filemode.c: Make the file description accurate.

10 months agoulc-asnprintf tests: Add test of %U, %s directives with large arguments.
Bruno Haible [Wed, 19 Jun 2024 18:58:18 +0000 (20:58 +0200)]
ulc-asnprintf tests: Add test of %U, %s directives with large arguments.

* tests/unistdio/test-ulc-asnprintf-big.c: New file, based on
tests/test-vasnprintf-big.c.
* modules/unistdio/ulc-asnprintf-extra-tests: New file.
* modules/unistdio/ulc-asnprintf-tests (Depends-on): Depend on it.

10 months agou8-asnprintf tests: Add test of %U, %s directives with large arguments.
Bruno Haible [Wed, 19 Jun 2024 18:56:17 +0000 (20:56 +0200)]
u8-asnprintf tests: Add test of %U, %s directives with large arguments.

* tests/unistdio/test-u8-asnprintf-big.c: New file, based on
tests/test-vasnprintf-big.c.
* modules/unistdio/u8-asnprintf-extra-tests: New file.
* modules/unistdio/u8-asnprintf-tests (Depends-on): Depend on it.

10 months agovasnprintf tests: Add test of %s directive with large arguments.
Bruno Haible [Wed, 19 Jun 2024 18:52:08 +0000 (20:52 +0200)]
vasnprintf tests: Add test of %s directive with large arguments.

* tests/test-vasnprintf-big.c: New file.
* modules/vasnprintf-extra-tests: New file.
* modules/vasnprintf-tests (Depends-on): Depend on it.

10 months agovasnprintf, u*-vasnprintf: Support string arguments longer than 2 GiB.
Bruno Haible [Wed, 19 Jun 2024 18:46:47 +0000 (20:46 +0200)]
vasnprintf, u*-vasnprintf: Support string arguments longer than 2 GiB.

* lib/vasnprintf.c: Include <stdint.h>.
(VASNPRINTF): In 64-bit builds, handle the %s directive ourselves.
(local_strnlen): Adjust #if condition.
* modules/unistdio/u8-vasnprintf (Depends-on): Add stdint.
* modules/unistdio/u8-u8-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u16-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u16-u16-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u32-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u32-u32-vasnprintf (Depends-on): Likewise.
* modules/unistdio/ulc-vasnprintf (Depends-on): Likewise.

10 months agovasnwprintf: Optimize handling of %c directive.
Bruno Haible [Wed, 19 Jun 2024 13:20:21 +0000 (15:20 +0200)]
vasnwprintf: Optimize handling of %c directive.

* lib/vasnprintf.c (VASNPRINTF): Use a single ENSURE_ALLOCATION instead
of two.

10 months agou*-vasnprintf: Fix a rare memory leak.
Bruno Haible [Wed, 19 Jun 2024 12:57:40 +0000 (14:57 +0200)]
u*-vasnprintf: Fix a rare memory leak.

* lib/vasnprintf.c (VASNPRINTF): Use ENSURE_ALLOCATION_ELSE instead of
ENSURE_ALLOCATION, to free temporary allocations before failing due to
out-of-memory.

10 months agou*-vasnprintf: Improve comments.
Bruno Haible [Wed, 19 Jun 2024 12:39:02 +0000 (14:39 +0200)]
u*-vasnprintf: Improve comments.

* lib/vasnprintf.c (VASNPRINTF): Improve comments.

10 months agou*-vasnprintf tests: Add more tests of %U, %lU, %llU directives.
Bruno Haible [Wed, 19 Jun 2024 07:27:55 +0000 (09:27 +0200)]
u*-vasnprintf tests: Add more tests of %U, %lU, %llU directives.

* tests/unistdio/test-u8-printf1.h (test_xfunction): Add more tests of
%U, %lU, %llU directives with width and non-ASCII argument.
* tests/unistdio/test-u16-printf1.h (test_xfunction): Likewise.
* tests/unistdio/test-u32-printf1.h (test_xfunction): Likewise.
* tests/unistdio/test-ulc-vasnprintf2.c (test_function): Likewise.
* tests/unistdio/test-ulc-vasnprintf3.c (test_function): Likewise.

10 months agofilemode tests: Tweak.
Bruno Haible [Wed, 19 Jun 2024 07:42:42 +0000 (09:42 +0200)]
filemode tests: Tweak.

* tests/test-filemode.c: Update comment.
* modules/filemode-tests (Depends-on): Add unistd.

10 months agofilemode: Add tests.
Collin Funk [Wed, 19 Jun 2024 04:21:47 +0000 (21:21 -0700)]
filemode: Add tests.

* modules/filemode-tests: New file.
* tests/test-filemode.c: New file.

10 months agocopysignl tests: Avoid failure on Solaris 11.4.
Bruno Haible [Wed, 19 Jun 2024 00:58:34 +0000 (02:58 +0200)]
copysignl tests: Avoid failure on Solaris 11.4.

* tests/test-copysignl.c: Include <float.h>.
(LDBL_BYTES): New macro.
(main): Use it instead of sizeof (long double).
* modules/copysignl-tests (Depends-on): Add float.

10 months agombsnlen: Add tests.
Bruno Haible [Wed, 19 Jun 2024 00:32:00 +0000 (02:32 +0200)]
mbsnlen: Add tests.

* tests/test-mbsnlen.c: New file.
* tests/test-mbsnlen.sh: New file, based on tests/test-mbsspn.sh.
* modules/mbsnlen-tests: New file.

10 months agombsnlen: Fix bug (regression 2023-09-26).
Bruno Haible [Wed, 19 Jun 2024 00:31:30 +0000 (02:31 +0200)]
mbsnlen: Fix bug (regression 2023-09-26).

* lib/mbsnlen.c (mbsnlen): Fix bug in GNULIB_MCEL_PREFER implementation.

10 months agombslen: Add tests.
Bruno Haible [Tue, 18 Jun 2024 22:45:46 +0000 (00:45 +0200)]
mbslen: Add tests.

* tests/test-mbslen.c: New file.
* tests/test-mbslen.sh: New file, based on tests/test-mbsspn.sh.
* modules/mbslen-tests: New file.

10 months agou*-vasnprintf tests: Add tests of %ls directive.
Bruno Haible [Tue, 18 Jun 2024 17:21:53 +0000 (19:21 +0200)]
u*-vasnprintf tests: Add tests of %ls directive.

* tests/unistdio/test-u8-vasnprintf2.c (test_function): Add tests of
the %ls directive with non-ASCII argument.
* tests/unistdio/test-u8-vasnprintf3.c (test_function): Likewise.
* tests/unistdio/test-u16-vasnprintf2.c (test_function): Likewise.
* tests/unistdio/test-u16-vasnprintf3.c (test_function): Likewise.
* tests/unistdio/test-u32-vasnprintf2.c (test_function): Likewise.
* tests/unistdio/test-u32-vasnprintf3.c (test_function): Likewise.
* tests/unistdio/test-ulc-vasnprintf2.c (test_function): Likewise.
* tests/unistdio/test-ulc-vasnprintf3.c (test_function): Likewise.

10 months agou*-vasnprintf: Fix handling of %ls, %lc directives on Solaris, MSVC.
Bruno Haible [Tue, 18 Jun 2024 17:18:27 +0000 (19:18 +0200)]
u*-vasnprintf: Fix handling of %ls, %lc directives on Solaris, MSVC.

* lib/vasnprintf.c (VASNPRINTF): When implementing the %ls, %lc
directives ourselves: Rename variable 'characters' to 'bytes'. Also
count characters, if necessary for the width handling. Fix
DCHAR_MBSNLEN invocation.

10 months agovasnprintf: Refactor.
Bruno Haible [Tue, 18 Jun 2024 01:16:17 +0000 (03:16 +0200)]
vasnprintf: Refactor.

* lib/vasnprintf.c (VASNPRINTF) [!DCHAR_IS_TCHAR]: Reduce the scope of
the tmpsrc variables.

10 months agonstrftime: tweak volatile access
Paul Eggert [Tue, 18 Jun 2024 15:21:44 +0000 (08:21 -0700)]
nstrftime: tweak volatile access

* lib/strftime.c (utc_timezone): Avoid unnecessary access to volatile.

10 months agonstrftime: Fix crash on NetBSD 10.0.
Bruno Haible [Tue, 18 Jun 2024 12:58:30 +0000 (14:58 +0200)]
nstrftime: Fix crash on NetBSD 10.0.

* lib/strftime.c (utc_timezone_cache): New variable.
(utc_timezone): New function.
(underlying_strftime): Use it when tz is NULL.

10 months agoc-nstrftime: Fix warning on platforms without strftime_l.
Bruno Haible [Tue, 18 Jun 2024 12:27:18 +0000 (14:27 +0200)]
c-nstrftime: Fix warning on platforms without strftime_l.

* lib/strftime.c: Add comment regarding HAVE_STRFTIME_L.
(underlying_strftime): Don't define if this function is not used.
Correct indentation. Simplify #if condition.
(__strftime_internal): Disable code that is not used on platforms
without strftime_l.

10 months agoImprove wording for Y2038 and largefile probes
Paul Eggert [Tue, 18 Jun 2024 04:08:29 +0000 (21:08 -0700)]
Improve wording for Y2038 and largefile probes

This change syncs from Autoconf master.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-06/msg00181.html
* m4/largefile.m4 (_AC_SYS_YEAR2038_PROBE)
(_AC_SYS_LARGEFILE_PROBE): Improve wording of chatter.

10 months agonstrftime: fix bug with -0000 on Solaris 11
Paul Eggert [Tue, 18 Jun 2024 03:47:09 +0000 (20:47 -0700)]
nstrftime: fix bug with -0000 on Solaris 11

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-06/msg00201.html
* lib/strftime.c (strftime) [!_LIBC]: Move #undef up.
(underlying_strftime) [!_LIBC]: New function, containing most of
what __strftime_internal used to do at the underlying_strftime label.
(get_tm_zone): New function, containing much of what
__strftime_internal used to do for %Z.
Be consistent about using "UTC" rather than "GMT";
this changes behavior only on platforms lacking tm_zone.
(__strftime_internal): Use them to compute time zone abbreviation
when needed.  Make ‘zone’ more local, and compute it only if
needed.  Simplify by removing set_and_revert_tz local var and its
uses; no longer needed now that we have get_tm_zone.  Do not
assume %EZ and %OZ are equivalent to %Z.

10 months agonstrftime: Correct indentation.
Bruno Haible [Tue, 18 Jun 2024 00:32:56 +0000 (02:32 +0200)]
nstrftime: Correct indentation.

* lib/strftime.c (__strftime_internal): Correct indentation of
preprocessor directives.

10 months agonstrftime: improve fix for NetBSD link errors
Paul Eggert [Mon, 17 Jun 2024 23:16:29 +0000 (16:16 -0700)]
nstrftime: improve fix for NetBSD link errors

This makes the NetBSD code thread-safe and presumably faster.
* lib/strftime.c (HAVE_NATIVE_TIME_Z): New macro.
(__strftime_internal): If HAVE_NATIVE_TIME_Z, use strftime_lz
or strftime_z instead of setting and reverting TZ.
* lib/time-internal.c: Remove, reverting recent change.
* lib/time_rz.c, modules/time_rz: Also revert recent changes,
since the relevant functions can now remain private to time_rz.c.
* m4/c-nstrftime.m4 (gl_C_GNU_STRFTIME): Check for strftime_lz.
* m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Check for strftime_z.

10 months agovasnprintf: Fix test failure on Cygwin.
Bruno Haible [Mon, 17 Jun 2024 19:53:30 +0000 (21:53 +0200)]
vasnprintf: Fix test failure on Cygwin.

* m4/vasnprintf.m4 (gl_FUNC_VASNPRINTF): Require AC_CANONICAL_HOST. Test
whether vasnprintf works reliably; invoke gl_REPLACE_VASNPRINTF if not.

10 months agonstrftime, c-nstrftime: Fix crash on Solaris 11.4.
Bruno Haible [Mon, 17 Jun 2024 14:47:56 +0000 (16:47 +0200)]
nstrftime, c-nstrftime: Fix crash on Solaris 11.4.

* lib/strftime.c (__strftime_internal): Restore protection against zone
being NULL.

10 months agotime_rz: Fix link errors on NetBSD (regression yesterday).
Bruno Haible [Mon, 17 Jun 2024 14:31:59 +0000 (16:31 +0200)]
time_rz: Fix link errors on NetBSD (regression yesterday).

* lib/time-internal.c: New file, extracted from lib/time_rz.c.
(tzgetname): New function.
* lib/time_rz.c (getenv_TZ, setenv_TZ, change_env, set_tz, revert_tz):
Moved to lib/time-internal.c.
* modules/time_rz (Files): Add lib/time-internal.c.
(Depends-on): Update.
(Makefile.am): Arrange to compile time-internal.c on all platforms.

10 months agodoc: Update for macOS 12, 13, 14.
Bruno Haible [Mon, 17 Jun 2024 11:50:43 +0000 (13:50 +0200)]
doc: Update for macOS 12, 13, 14.

* doc/posix-headers/*.texi: Update.
* doc/glibc-headers/*.texi: Update.
* doc/posix-functions/*.texi: Likewise.
* doc/pastposix-functions/*.texi: Likewise.
* doc/glibc-functions/*.texi: Likewise.
* m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Update cross-compilation
guess.
* m4/printf.m4 (gl_PRINTF_DIRECTIVE_A): Update comments.
* m4/readlinkat.m4 (gl_FUNC_READLINKAT): Likewise.

10 months agouseless-if-before-free: Check for nullptr.
Collin Funk [Mon, 17 Jun 2024 03:45:33 +0000 (20:45 -0700)]
useless-if-before-free: Check for nullptr.

* build-aux/useless-if-before-free (is_NULL): Add nullptr to the
condition.
(foo): Add nullptr to the regular expressions.

10 months agonstrftime: omit never-used code
Paul Eggert [Sun, 16 Jun 2024 22:48:24 +0000 (15:48 -0700)]
nstrftime: omit never-used code

* lib/strftime.c (__strftime_internal): Remove code protected by
‘#ifndef my_strftime’.  my_strftime is always defined.  This
code isn’t needed for POSIX conformance as it’s never used in glibc.

10 months agonstrftime,time_rz: don’t depend on tzname
Paul Eggert [Sun, 16 Jun 2024 22:44:17 +0000 (15:44 -0700)]
nstrftime,time_rz: don’t depend on tzname

* lib/strftime.c (HAVE_TZNAME_ARRAY) [_LIBC]: Remove.
All uses removed.
(__strftime_internal): Simplify calculation of zone to be closer
to what glibc does.  However, in Gnulib do not look at tzname as
this is problematic for all the usual reasons; instead, use the
underlying strftime with %Z, making sure that call to the
underlying strftime is now always compiled in the non-glibc case.
Set and revert TZ as needed around the underlying call.
* lib/time-internal.h (struct tm_zone)
[HAVE_TZNAME_ARRAY && !HAVE_STRUCT_TM_TM_ZONE]: Remove tzname_copy.
All uses removed.
(set_tz, revert_tz): Declare, as they’re now extern.
(local_tz): Move here from time_rz.c, and now a macro.
* lib/time_rz.c (save_abbr): Do not worry about tzname_copy,
since strftime.c no longer needs it.  Instead, save abbrs
only from tm_zone.
* modules/c-nstrftime, modules/nstrftime, modules/time_rz:
(Depends-on): Remove tzname.

10 months agoparse-datetime: don’t depend on tzname
Paul Eggert [Sun, 16 Jun 2024 21:58:56 +0000 (14:58 -0700)]
parse-datetime: don’t depend on tzname

* lib/parse-datetime.y (TIME_ZONE_BUFSIZE): Move earlier.
(parser_control) [!HAVE_STRUCT_TM_TM_ZONE]:
New member tz_abbr, to save abbrs calculated by strftime %Z.
(populate_local_time_zone_table): New function, which
optimizes the HAVE_STRUCT_TM_TM_ZONE case as before,
and falls back on strftime with %Z otherwise.
Although strftime %Z can be more accurate than the old tzname
based method, the new heuristic is still wrong so often that it
probably doesn’t help all that much.
(parse_datetime_body): Use it.
* modules/parse-datetime (Depends-on): Remove tzname.

10 months agotime_r: refactor tm_zone tests
Paul Eggert [Sun, 16 Jun 2024 21:44:29 +0000 (14:44 -0700)]
time_r: refactor tm_zone tests

* m4/tm_gmtoff.m4 (gl_TM_GMTOFF): Also check for tm_zone
and define HAVE_STRUCT_TM_TM_ZONE accordingly.
* modules/time_r-tests (Files): Add m4/tm_gmtoff.m4.
(configure.ac): Simplify by using gl_TM_GMTOFF.

10 months agotime: document struct tm portability
Paul Eggert [Sun, 16 Jun 2024 21:17:01 +0000 (14:17 -0700)]
time: document struct tm portability

* doc/posix-headers/time.texi: Mention issues with tm_gmtoff,
tm_zone, tzname, etc.

10 months agotime_r-tests: avoid tzname test
Paul Eggert [Sun, 16 Jun 2024 17:24:07 +0000 (10:24 -0700)]
time_r-tests: avoid tzname test

* modules/time_r-tests (configure.ac):
Do not check for tzname, as the tests don’t use it.
Simply check for struct tm.tm_zone.

10 months agonstrftime: rename HAVE_TM_GMTOFF
Paul Eggert [Sun, 16 Jun 2024 17:17:47 +0000 (10:17 -0700)]
nstrftime: rename HAVE_TM_GMTOFF

* m4/tm_gmtoff.m4 (gl_TM_GMTOFF): Rename HAVE_TM_GMTOFF
to HAVE_STRUCT_TM_TM_GMTOFF, for consistency with
HAVE_STRUCT_TM_TM_ZONE.  All uses changed.

10 months agoDrop outdated cppi configuration.
Bruno Haible [Sat, 15 Jun 2024 21:33:16 +0000 (23:33 +0200)]
Drop outdated cppi configuration.

* lib/.cppi-disable: Remove file.

10 months agodoc: Update for glibc 2.39.
Bruno Haible [Sat, 15 Jun 2024 20:48:59 +0000 (22:48 +0200)]
doc: Update for glibc 2.39.

* doc/posix-functions/*scanf.texi: Update.

10 months agodoc: Update for glibc 2.39.
Bruno Haible [Sat, 15 Jun 2024 20:38:57 +0000 (22:38 +0200)]
doc: Update for glibc 2.39.

* doc/glibc-functions/pidfd_getpid.texi: New file.
* doc/glibc-functions/pidfd_spawn.texi: New file.
* doc/glibc-functions/pidfd_spawnp.texi: New file.
* doc/glibc-functions/posix_spawnattr_getcgroup_np.texi: New file.
* doc/glibc-functions/posix_spawnattr_setcgroup_np.texi: New file.
* doc/gnulib.texi: Include them.

10 months agodoc: Update for glibc 2.38.
Bruno Haible [Sat, 15 Jun 2024 15:29:39 +0000 (17:29 +0200)]
doc: Update for glibc 2.38.

* doc/posix-functions/strlcat.texi: New file.
* doc/posix-functions/strlcpy.texi: New file.
* doc/gnulib.texi: Include them.
* doc/posix-headers/inttypes.texi: Update.
* doc/posix-functions/*printf.texi: Update.

10 months agodoc: Update for glibc 2.36.
Bruno Haible [Sat, 15 Jun 2024 14:49:54 +0000 (16:49 +0200)]
doc: Update for glibc 2.36.

* doc/posix-functions/c8rtomb.texi: Update.
* doc/posix-functions/mbrtoc8.texi: Update.
* doc/glibc-functions/arc4random.texi: New file.
* doc/glibc-functions/arc4random_buf.texi: New file.
* doc/glibc-functions/arc4random_uniform.texi: New file.
* doc/glibc-functions/fsconfig.texi: New file.
* doc/glibc-functions/fsmount.texi: New file.
* doc/glibc-functions/fsopen.texi: New file.
* doc/glibc-functions/fspick.texi: New file.
* doc/glibc-functions/mount_setattr.texi: New file.
* doc/glibc-functions/move_mount.texi: New file.
* doc/glibc-functions/open_tree.texi: New file.
* doc/glibc-functions/pidfd_getfd.texi: New file.
* doc/glibc-functions/pidfd_open.texi: New file.
* doc/glibc-functions/pidfd_send_signal.texi: New file.
* doc/glibc-functions/process_madvise.texi: New file.
* doc/glibc-functions/process_mrelease.texi: New file.
* doc/gnulib.texi: Include them.
(Glibc sys/pidfd.h): New section.

10 months agognulib-tool.py: Revert previous change.
Collin Funk [Sat, 15 Jun 2024 12:42:18 +0000 (05:42 -0700)]
gnulib-tool.py: Revert previous change.

* pygnulib/constants.py (joinpath): Restore function and remove unused
local variable.
(relativize, symlink_relative, as_link_value_at_dest, hardlink): Use it.
* pygnulib/GLConfig.py (resetAutoconfFile): Likewise.
* pygnulib/GLEmiter.py (lib_Makefile_am, tests_Makefile_am): Likewise.
* pygnulib/GLFileSystem.py (lookup, shouldLink, tmpfilename, add)
(update, add_or_update, super_update): Likewise.
* pygnulib/GLImport.py (__init__, relative_to_currdir)
(_done_dir_, _update_ignorelist_, prepare, execute): Likewise.
* pygnulib/GLInfo.py (version): Likewise.
* pygnulib/GLMakefileTable.py (parent): Likewise.
* pygnulib/GLModuleSystem.py (exists, find, getFiles)
(getAutomakeSnippet_Unconditional): Likewise.
* pygnulib/GLTestDir.py (_patch_test_driver, execute): Likewise.
* pygnulib/main.py (main): Likewise.

10 months agotimespec-add,timespec-sub: tune
Paul Eggert [Sat, 15 Jun 2024 06:11:05 +0000 (23:11 -0700)]
timespec-add,timespec-sub: tune

* lib/timespec-add.c (timespec_add):
* lib/timespec-sub.c (timespec_sub):
Simplify by detecting overflow when the two overflow bits of the
underlying operation differ.  This avoids some gotos and labels
and conditional branches; GCC 14 x86-64 now generates just one
conditional branch for the resulting code.  Idea stolen from
my recent changes to the glibc manual’s time chapter.
* modules/timespec-add (Depends-on):
* modules/timespec-sub (Depends-on): Add stdbool.

10 months agognulib-tool.py: Simplify joining paths.
Collin Funk [Sat, 15 Jun 2024 04:55:48 +0000 (21:55 -0700)]
gnulib-tool.py: Simplify joining paths.

* pygnulib/constants.py (joinpath): Remove function. It is equivalent to
os.path.normpath(os.path.join(...)) where the os.path.normpath is
typically not needed.
(relativize, symlink_relative, as_link_value_at_dest, hardlink): Use
os.path.join instead of joinpath.
* pygnulib/GLConfig.py (resetAutoconfFile): Likewise.
* pygnulib/GLEmiter.py (lib_Makefile_am, tests_Makefile_am): Likewise.
* pygnulib/GLFileSystem.py (lookup, shouldLink, tmpfilename, add)
(update, add_or_update, super_update): Likewise.
* pygnulib/GLInfo.py (version): Likewise.
* pygnulib/GLMakefileTable.py (parent): Likewise.
* pygnulib/GLTestDir.py (_patch_test_driver, execute): Likewise.
* pygnulib/main.py (main): Likewise.
* pygnulib/GLModuleSystem.py (exists, find, getFiles): Likewise.
* pygnulib/GLImport.py (__init__, relative_to_currdir)
(_done_dir_, _update_ignorelist_, prepare, execute): Likewise.
(getAutomakeSnippet_Unconditional): Likewise. Add a comment about not
using os.path.normpath() to protect a Make variable.

10 months agoFix typos in ChangeLog and getpagesize.texi
Paul Eggert [Sat, 15 Jun 2024 03:59:43 +0000 (20:59 -0700)]
Fix typos in ChangeLog and getpagesize.texi

10 months agodoc: Update for glibc 2.35.
Bruno Haible [Sat, 15 Jun 2024 01:51:50 +0000 (03:51 +0200)]
doc: Update for glibc 2.35.

* doc/glibc-functions/_dl_find_object.texi: New file.
* doc/glibc-functions/epoll_pwait2.texi: New file.
* doc/glibc-functions/posix_spawn_file_actions_addtcsetpgrp_np.texi: New
file.
* doc/posix-functions/dfmal.texi: New file.
* doc/posix-functions/dsqrtl.texi: New file.
* doc/posix-functions/ffma.texi: New file.
* doc/posix-functions/ffmal.texi: New file.
* doc/posix-functions/fmaximum.texi: New file.
* doc/posix-functions/fmaximum_mag.texi: New file.
* doc/posix-functions/fmaximum_mag_num.texi: New file.
* doc/posix-functions/fmaximum_mag_numf.texi: New file.
* doc/posix-functions/fmaximum_mag_numl.texi: New file.
* doc/posix-functions/fmaximum_magf.texi: New file.
* doc/posix-functions/fmaximum_magl.texi: New file.
* doc/posix-functions/fmaximum_num.texi: New file.
* doc/posix-functions/fmaximum_numf.texi: New file.
* doc/posix-functions/fmaximum_numl.texi: New file.
* doc/posix-functions/fmaximumf.texi: New file.
* doc/posix-functions/fmaximuml.texi: New file.
* doc/posix-functions/fminimum.texi: New file.
* doc/posix-functions/fminimum_mag.texi: New file.
* doc/posix-functions/fminimum_mag_num.texi: New file.
* doc/posix-functions/fminimum_mag_numf.texi: New file.
* doc/posix-functions/fminimum_mag_numl.texi: New file.
* doc/posix-functions/fminimum_magf.texi: New file.
* doc/posix-functions/fminimum_magl.texi: New file.
* doc/posix-functions/fminimum_num.texi: New file.
* doc/posix-functions/fminimum_numf.texi: New file.
* doc/posix-functions/fminimum_numl.texi: New file.
* doc/posix-functions/fminimumf.texi: New file.
* doc/posix-functions/fminimuml.texi: New file.
* doc/posix-functions/fsqrt.texi: New file.
* doc/posix-functions/fsqrtl.texi: New file.
* doc/gnulib.texi: Include them.

10 months agodoc: More updates for glibc 2.34.
Bruno Haible [Sat, 15 Jun 2024 00:23:01 +0000 (02:23 +0200)]
doc: More updates for glibc 2.34.

* doc/glibc-functions/ns_name_compress.texi: New file.
* doc/glibc-functions/ns_name_ntop.texi: New file.
* doc/glibc-functions/ns_name_pack.texi: New file.
* doc/glibc-functions/ns_name_pton.texi: New file.
* doc/glibc-functions/ns_name_skip.texi: New file.
* doc/glibc-functions/ns_name_uncompress.texi: New file.
* doc/glibc-functions/ns_name_unpack.texi: New file.
* doc/gnulib.texi (Glibc arpa/nameser.h): New section.

10 months agodoc: More updates for glibc 2.34.
Bruno Haible [Fri, 14 Jun 2024 23:52:44 +0000 (01:52 +0200)]
doc: More updates for glibc 2.34.

* doc/glibc-functions/close_range.texi: New file.
* doc/gnulib.texi: Include it.

10 months agoxsize: port to SIZE_MAX <= INT_MAX
Paul Eggert [Fri, 14 Jun 2024 21:29:18 +0000 (14:29 -0700)]
xsize: port to SIZE_MAX <= INT_MAX

* lib/xsize.h (xsum): Port to oddball platforms where SIZE_MAX <=
INT_MAX.  Although no such platform is a current Gnulib porting
problems, it’s easy enough to port to them.

10 months agossfmalloc-tests: simplify by using sysconf
Paul Eggert [Fri, 14 Jun 2024 19:33:02 +0000 (12:33 -0700)]
ssfmalloc-tests: simplify by using sysconf

* tests/test-ssfmalloc.c (getpagesize) [__hpux]: Remove decl.
(init_pagesize): Use sysconf instead of getpagesize.

10 months agosigsegv-tests: port to plain POSIX
Paul Eggert [Fri, 14 Jun 2024 17:58:24 +0000 (10:58 -0700)]
sigsegv-tests: port to plain POSIX

* tests/test-sigsegv-catch-segv1.c, tests/test-sigsegv-catch-segv2.c:
(SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS):
Use sysconf (_SC_PAGESIZE) instead of getpagesize, as this code is
compiled only on platforms that have _SC_PAGESIZE and POSIX
prefers the latter.

10 months agofree-posix-tests: port to plain POSIX
Paul Eggert [Fri, 14 Jun 2024 17:54:36 +0000 (10:54 -0700)]
free-posix-tests: port to plain POSIX

* tests/test-free.c (main): Use sysconf (_SC_PAGESIZE) instead of
getpagesize, as this code is compiled only on platforms that have
_SC_PAGESIZE and POSIX prefers the latter.

10 months agomaint: avoid some test getpagesize dependencies
Paul Eggert [Fri, 14 Jun 2024 17:53:32 +0000 (10:53 -0700)]
maint: avoid some test getpagesize dependencies

* modules/memcasecmp-tests, modules/memchr-tests:
* modules/memchr2-tests, modules/memcmp-tests:
* modules/memmem-tests, modules/memrchr-tests:
* modules/rawmemchr-tests, modules/strncat-tests:
* modules/strnlen-tests, modules/strstr-tests:
* modules/unistr/u16-chr-tests, modules/unistr/u16-cmp-tests:
* modules/unistr/u16-stpncpy-tests:
* modules/unistr/u16-strchr-tests:
* modules/unistr/u16-strncat-tests:
* modules/unistr/u16-strncpy-tests:
* modules/unistr/u16-strnlen-tests, modules/unistr/u32-chr-tests:
* modules/unistr/u32-cmp-tests, modules/unistr/u32-stpncpy-tests:
* modules/unistr/u32-strchr-tests:
* modules/unistr/u32-strncat-tests:
* modules/unistr/u32-strncpy-tests:
* modules/unistr/u32-strnlen-tests, modules/unistr/u8-chr-tests:
* modules/unistr/u8-cmp-tests, modules/unistr/u8-stpncpy-tests:
* modules/unistr/u8-strchr-tests, modules/unistr/u8-strncat-tests:
* modules/unistr/u8-strncpy-tests:
* modules/unistr/u8-strnlen-tests, modules/wcsstr-tests:
Do not depend on getpagesize.
* tests/zerosize-ptr.h (zerosize_ptr): Use sysconf (_SC_PAGESIZE)
instead of getpagesize, as this code is compiled only on
platforms that have _SC_PAGESIZE.

10 months agomprotect: don’t assume pointers fit in long
Paul Eggert [Fri, 14 Jun 2024 17:47:06 +0000 (10:47 -0700)]
mprotect: don’t assume pointers fit in long

* m4/mprotect.m4 (gl_FUNC_MPROTECT_WORKS): Don’t assume pointers
fit into unsigned long, as this is not true on CheriBSD.  Prefer
sysconf (_SC_PAGESIZE) to getpagesize.

10 months agomemchr,strncat: prefer sysconf (_SC_PAGESIZE)
Paul Eggert [Fri, 14 Jun 2024 17:42:40 +0000 (10:42 -0700)]
memchr,strncat: prefer sysconf (_SC_PAGESIZE)

* m4/memchr.m4 (gl_FUNC_MEMCHR):
* m4/strncat.m4 (gl_FUNC_STRNCAT):
Use sysconf (_SC_PAGESIZE) instead of getpagesize, as it’s
in POSIX and there’s no point to worrying about getpagesize
performance advantages here.

10 months agogetcwd: simplify abort bug checking
Paul Eggert [Fri, 14 Jun 2024 17:26:30 +0000 (10:26 -0700)]
getcwd: simplify abort bug checking

* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Don’t invoke
gl_CHECK_FUNC_GETPAGESIZE or #define or use HAVE_GETPAGESIZE.
Protect ‘bug_possible’ with ‘defined _SC_PAGESIZE’ instead.
That’s good enough as the buggy platforms all define _SC_PAGESIZE.
* modules/getcwd (Files): Remove m4/getpagesize.m4.
* tests/test-getcwd.c (getpagsize): Remove replacement macro.
(test_abort_bug): Similar fix for ‘bug_possible’.

10 months agogetpagesize: remove outdated ref
Paul Eggert [Fri, 14 Jun 2024 17:21:02 +0000 (10:21 -0700)]
getpagesize: remove outdated ref

* lib/.cppi-disable: Remove getpagesize.h.

10 months agogetpagesize: improve doc
Paul Eggert [Fri, 14 Jun 2024 17:20:21 +0000 (10:20 -0700)]
getpagesize: improve doc

* doc/glibc-functions/getpagesize.texi:
Mention portability problems not fixed by Gnulib.

10 months agovasnprintf: Reject a width > INT_MAX.
Bruno Haible [Fri, 14 Jun 2024 17:53:42 +0000 (19:53 +0200)]
vasnprintf: Reject a width > INT_MAX.

* lib/vasnprintf.c (VASNPRINTF): If a width is > INT_MAX, fail with
EOVERFLOW.
* tests/test-vasnprintf.c: Include <errno.h>.
(test_function): Test huge widths.
* tests/test-vasnwprintf.c: Include <errno.h>.
(test_function): Test huge widths.
* tests/unistdio/test-u8-asnprintf1.h (test_function): Test huge widths.
* tests/unistdio/test-u16-asnprintf1.h (test_function): Likewise.
* tests/unistdio/test-u32-asnprintf1.h (test_function): Likewise.
* tests/unistdio/test-ulc-asnprintf1.h (test_function): Likewise.
* tests/unistdio/test-ulc-asnprintf1.c: Include <errno.h>.
* tests/unistdio/test-ulc-vasnprintf1.c: Likewise.

10 months agorelocatable-prog: Implement --help and --version for all programs.
Bruno Haible [Fri, 14 Jun 2024 11:31:45 +0000 (13:31 +0200)]
relocatable-prog: Implement --help and --version for all programs.

* build-aux/config.libpath (func_usage, func_version, func_fatal_error):
New functions.
Add command-line option processing.
* build-aux/libtool-reloc (func_usage, func_version, func_fatal_error):
New functions.
Add command-line option processing.
* build-aux/reloc-ldflags (func_usage, func_version, func_fatal_error):
New functions.
Add command-line option processing.

10 months agorelocatable-prog-wrapper: Implement --help, --version for all programs.
Bruno Haible [Fri, 14 Jun 2024 10:50:45 +0000 (12:50 +0200)]
relocatable-prog-wrapper: Implement --help, --version for all programs.

* build-aux/install-reloc (func_usage, func_version, func_fatal_error):
New functions.
(progname): Remove variable.
Add command-line option processing.

10 months agohavelib: Implement --help and --version for all programs.
Bruno Haible [Fri, 14 Jun 2024 10:35:03 +0000 (12:35 +0200)]
havelib: Implement --help and --version for all programs.

* build-aux/config.rpath (func_usage, func_version, func_fatal_error):
New functions.
Add command-line option processing.

10 months agoImprove bug reporting address for some programs.
Bruno Haible [Fri, 14 Jun 2024 00:35:40 +0000 (02:35 +0200)]
Improve bug reporting address for some programs.

* build-aux/declared.sh (func_usage): Change bug reporting address to
bug-gnulib.
(func_version): Bump year. Improve "Written by" line.
* build-aux/libtool-next-version (func_usage): Change bug reporting
address to bug-gnulib.
* build-aux/run-test (func_usage): Change bug reporting address to
bug-gnulib.
(func_version): Bump year. Improve "Written by" line.

10 months agoAssume wchar_t.
Bruno Haible [Thu, 13 Jun 2024 22:28:45 +0000 (00:28 +0200)]
Assume wchar_t.

* lib/stddef.in.h (wchar_t): Remove fallback definition.
* m4/stddef_h.m4 (gl_STDDEF_H): Don't require gt_TYPE_WCHAR_T. Assume
gt_cv_c_wchar_t is 'yes'.
(gl_STDDEF_H_DEFAULTS): Don't initialize HAVE_WCHAR_T.
* modules/stddef (Files): Remove m4/wchar_t.m4.
(Makefile.am): Don't substitute HAVE_WCHAR_T.
* doc/posix-headers/stddef.texi: Don't mention the problem of a missing
wchar_t.

* lib/printf-args.h (arg_type): Assume HAVE_WCHAR_T is 1.
* lib/printf-args.c (PRINTF_FETCHARGS): Likewise.
* lib/printf-parse.c (PRINTF_PARSE): Likewise.
* lib/vasnprintf.c: Likewise.
* m4/vasnprintf.m4 (gl_PREREQ_PRINTF_ARGS, gl_PREREQ_PRINTF_PARSE,
gl_PREREQ_VASNXPRINTF): Don't require gt_TYPE_WCHAR_T.
* modules/c-vasnprintf (Files): Remove m4/wchar_t.m4.
* modules/vasnprintf (Files): Likewise.
* modules/vasnwprintf (Files): Likewise.
* modules/unistdio/u16-u16-vasnprintf (Files): Likewise.
* modules/unistdio/u16-vasnprintf (Files): Likewise.
* modules/unistdio/u32-u32-vasnprintf (Files): Likewise.
* modules/unistdio/u32-vasnprintf (Files): Likewise.
* modules/unistdio/u8-u8-vasnprintf (Files): Likewise.
* modules/unistdio/u8-vasnprintf (Files): Likewise.
* modules/unistdio/ulc-vasnprintf (Files): Likewise.
* tests/test-sprintf-posix.h (test_function): Assume HAVE_WCHAR_T is 1.
* tests/test-snprintf-posix.h (test_function): Likewise.
* tests/test-vasnprintf-posix.c (test_function): Likewise.
* tests/test-vasnwprintf-posix.c (test_function): Likewise.
* tests/test-vasprintf-posix.c (test_function): Likewise.

* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Don't require gt_TYPE_WCHAR_T.
* modules/wcwidth (Files): Remove m4/wchar_t.m4.

* tests/test-stdint.c: Assume HAVE_WCHAR_T is 1.
* modules/stdint-tests (Files): Remove m4/wchar_t.m4.
(configure.ac): Don't require gt_TYPE_WCHAR_T.

* m4/wchar_t.m4: Remove file.

10 months agogitlog-to-changelog: Ensure that use of keys() is deterministic.
Yves Orton [Thu, 13 Jun 2024 21:44:05 +0000 (23:44 +0200)]
gitlog-to-changelog: Ensure that use of keys() is deterministic.

Reported at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25629>
via Karl Berry.

* build-aux/gitlog-to-changelog: Iterate over hash table in a
predictable order.

Copyright-paperwork-exempt: Yes

10 months agogendocs: Ensure that use of keys() is deterministic.
Yves Orton [Thu, 13 Jun 2024 21:43:10 +0000 (23:43 +0200)]
gendocs: Ensure that use of keys() is deterministic.

Reported at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25629>
via Karl Berry.

* build-aux/gendocs.sh (copy_images): Iterate over hash table in a
predictable order.

Copyright-paperwork-exempt: Yes

10 months agoautoupdate
Karl Berry [Thu, 13 Jun 2024 16:28:20 +0000 (09:28 -0700)]
autoupdate

10 months agoparse-datetime: Revert last commit.
Bruno Haible [Wed, 12 Jun 2024 02:10:17 +0000 (04:10 +0200)]
parse-datetime: Revert last commit.

* modules/parse-datetime (Makefile.am): Remove the '$(srcdir)/' prefix
from the target. Add a comment.

10 months agomktempd: use GNU-style -t if available
Paul Eggert [Tue, 11 Jun 2024 22:09:55 +0000 (15:09 -0700)]
mktempd: use GNU-style -t if available

This better satisfies Jim Meyering’s point in:
https://lists.gnu.org/archive/html/bug-gnulib/2016-03/msg00074.html
that it’s more useful when each temporary test directory name
includes the corresponding test’s name.
* build-aux/mktempd: Try mktemp -t only with GNU syntax, so that
NetBSD mktemp fails.  Also, reject templates beginning with "-" so
that they are not treated as options.
* tests/init.sh (mktempd_): Likewise.

10 months agoparse-datetime: Add support for VPATH builds with OpenBSD 'make'.
Bruno Haible [Tue, 11 Jun 2024 21:31:33 +0000 (23:31 +0200)]
parse-datetime: Add support for VPATH builds with OpenBSD 'make'.

* modules/parse-datetime (Makefile.am): Prefix the target file name
with '$(srcdir)/'.

10 months agomktempd: Invoke mktemp portably.
Collin Funk [Tue, 11 Jun 2024 21:16:34 +0000 (14:16 -0700)]
mktempd: Invoke mktemp portably.

* build-aux/mktempd (mktempd): Don't use -t when invoking mktemp since
some implementations expect an argument while others do not.

10 months agotest-framework-sh: Fix 'returns_' to not turn off tracing permanently.
Bruno Haible [Tue, 11 Jun 2024 18:42:12 +0000 (20:42 +0200)]
test-framework-sh: Fix 'returns_' to not turn off tracing permanently.

* tests/init.sh (returns_): Restore tracing if it was enabled before.

10 months agomaint: avoid duplicate tight-scope work
Paul Eggert [Tue, 11 Jun 2024 17:16:37 +0000 (10:16 -0700)]
maint: avoid duplicate tight-scope work

* top/maint.mk (_gl_tight_scope): Sort $(SOURCES), to remove
duplicates and thereby avoid unnecessary work.  Found when testing
this on GNU diffutils.

10 months agoautoupdate
Karl Berry [Mon, 10 Jun 2024 22:49:47 +0000 (15:49 -0700)]
autoupdate

10 months agognulib-tool.py: Handle absolute path checks consistently.
Collin Funk [Mon, 10 Jun 2024 01:08:00 +0000 (18:08 -0700)]
gnulib-tool.py: Handle absolute path checks consistently.

* pygnulib/GLImport.py (GLImport.relative_to_destdir)
(GLImport.relative_to_currdir): Use os.path.isabs() instead of checking
for a slash.
* pygnulib/constants.py (symlink_relative, as_link_value_at_dest)
(hardlink): Use os.path.isabs() instead of checking for a slash or drive
prefix.

10 months agoc32width tests: Avoid a test failure on Solaris 11 OpenIndiana, OmniOS.
Bruno Haible [Sun, 9 Jun 2024 23:51:30 +0000 (01:51 +0200)]
c32width tests: Avoid a test failure on Solaris 11 OpenIndiana, OmniOS.

* tests/test-c32width.c (main): On Solaris, disable two tests that fail
on Solaris 11 OpenIndiana and Solaris 11 OmniOS.

10 months agoc32ispunct tests: Avoid a test failure on Solaris 11 OmniOS.
Bruno Haible [Sun, 9 Jun 2024 17:32:34 +0000 (19:32 +0200)]
c32ispunct tests: Avoid a test failure on Solaris 11 OmniOS.

* tests/test-c32ispunct.c (main): On Solaris, disable two tests that
fail in the zh_CN.GB18030 locale on Solaris 11 OmniOS.

10 months agoc32rtomb: Add a sanity check, working around Solaris 11 OmniOS.
Bruno Haible [Sun, 9 Jun 2024 17:16:01 +0000 (19:16 +0200)]
c32rtomb: Add a sanity check, working around Solaris 11 OmniOS.

* m4/c32rtomb.m4 (gl_CHECK_FUNC_C32RTOMB): New macro, extracted from
gl_FUNC_C32RTOMB.
(gl_C32RTOMB_SANITYCHECK): New macro.
(gl_FUNC_C32RTOMB): Require gl_CHECK_FUNC_C32RTOMB and
gl_C32RTOMB_SANITYCHECK. If HAVE_WORKING_C32RTOMB is 0, set
REPLACE_C32RTOMB.
* lib/c32rtomb.c (c32rtomb): Together with HAVE_WORKING_MBRTOC32, test
also HAVE_WORKING_C32RTOMB.

* m4/mbrtoc32.m4 (gl_PREREQ_MBRTOC32): Require gl_C32RTOMB_SANITYCHECK.
* lib/mbrtoc32.c (mbrtoc32): Together with HAVE_WORKING_MBRTOC32, test
also HAVE_WORKING_C32RTOMB.
* modules/mbrtoc32 (Files): Add m4/c32rtomb.m4.

* lib/btoc32.c (btoc32): Together with HAVE_WORKING_MBRTOC32, test also
HAVE_WORKING_C32RTOMB.

* lib/mbsrtoc32s.c: Together with HAVE_WORKING_MBRTOC32, test also
HAVE_WORKING_C32RTOMB.

* lib/mbsnrtoc32s.c: Together with HAVE_WORKING_MBRTOC32, test also
HAVE_WORKING_C32RTOMB.

* lib/c32tob.c (c32tob): Together with HAVE_WORKING_MBRTOC32, test also
HAVE_WORKING_C32RTOMB.
* modules/c32tob (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.

* lib/c32srtombs.c: Together with HAVE_WORKING_MBRTOC32, test also
HAVE_WORKING_C32RTOMB.

* lib/c32snrtombs.c: Together with HAVE_WORKING_MBRTOC32, test also
HAVE_WORKING_C32RTOMB.

* lib/c32is-impl.h (FUNC): Together with HAVE_WORKING_MBRTOC32, test
also HAVE_WORKING_C32RTOMB.
* modules/c32isalnum (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isalpha (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isblank (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32iscntrl (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isdigit (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isgraph (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32islower (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isprint (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32ispunct (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isspace (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isupper (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32isxdigit (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.

* lib/c32to-impl.h (FUNC): Together with HAVE_WORKING_MBRTOC32, test
also HAVE_WORKING_C32RTOMB.
* modules/c32tolower (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.
* modules/c32toupper (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.

* lib/c32width.c (c32width): Together with HAVE_WORKING_MBRTOC32, test
also HAVE_WORKING_C32RTOMB.
* modules/c32width (Files): Add m4/c32rtomb.m4.
(configure.ac): Require gl_C32RTOMB_SANITYCHECK.

10 months agoc32isblank tests: Avoid test failure on NetBSD 10.0.
Bruno Haible [Sat, 8 Jun 2024 19:03:39 +0000 (21:03 +0200)]
c32isblank tests: Avoid test failure on NetBSD 10.0.

* tests/test-c32isblank.c (main): Disable test of '\f', that fails in
the fr_FR.UTF-8 locale.

10 months agousleep tests: Avoid failure due to known Cygwin 3.5.3 bug.
Bruno Haible [Sat, 8 Jun 2024 12:21:57 +0000 (14:21 +0200)]
usleep tests: Avoid failure due to known Cygwin 3.5.3 bug.

* modules/usleep-tests (Depends-on): Add test-xfail.
(Makefile.am): Don't test test-usleep on Cygwin.

10 months agotest-framework-sh: Don't leave temporary directories on NetBSD.
Collin Funk [Sat, 8 Jun 2024 09:56:48 +0000 (02:56 -0700)]
test-framework-sh: Don't leave temporary directories on NetBSD.

Reported by Taylor R Campbell <riastradh@NetBSD.org> in
<https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58319>

* tests/init.sh (mktempd_): Don't use mktemp with the -t option as it
leads to uncleaned temporary directories on NetBSD.

10 months agopthread_sigmask tests: Avoid failure due to known NetBSD 10.0 bug.
Bruno Haible [Fri, 7 Jun 2024 20:42:06 +0000 (22:42 +0200)]
pthread_sigmask tests: Avoid failure due to known NetBSD 10.0 bug.

* modules/pthread_sigmask-tests (Depends-on): Add test-xfail.
(Makefile.am): Don't test test-pthread_sigmask1 on NetBSD.

10 months agosigprocmask tests: Avoid failure due to known NetBSD 10.0 bug.
Bruno Haible [Fri, 7 Jun 2024 20:41:07 +0000 (22:41 +0200)]
sigprocmask tests: Avoid failure due to known NetBSD 10.0 bug.

* modules/sigprocmask-tests (Depends-on): Add test-xfail.
(Makefile.am): Don't test test-sigprocmask on NetBSD.

10 months agoUpdate HACKING.
Bruno Haible [Fri, 7 Jun 2024 16:38:26 +0000 (18:38 +0200)]
Update HACKING.

* HACKING: Mention the new many-platforms continuous integration.

10 months agoSpelling fix from Automake
Paul Eggert [Fri, 7 Jun 2024 16:44:49 +0000 (09:44 -0700)]
Spelling fix from Automake

10 months agousleep: Document Cygwin bug.
Bruno Haible [Fri, 7 Jun 2024 09:30:36 +0000 (11:30 +0200)]
usleep: Document Cygwin bug.

* doc/pastposix-functions/usleep.texi: Mention Cygwin 3.5.3 bug.

10 months agotzname: document some limitations
Paul Eggert [Thu, 6 Jun 2024 19:54:21 +0000 (12:54 -0700)]
tzname: document some limitations

Unfortunately tzname is a vestigial interface that doesn't work
<https://data.iana.org/time-zones/theory.html#vestigial>.
It's relatively useless in portable code and is planned to be removed
from POSIX <https://austingroupbugs.net/view.php?id=1816>.
Document this better here.

10 months agonstrftime, c-nstrftime: Support time zone names on MSVC.
Bruno Haible [Thu, 6 Jun 2024 16:29:51 +0000 (18:29 +0200)]
nstrftime, c-nstrftime: Support time zone names on MSVC.

* lib/strftime.c: Use HAVE_TZNAME_ARRAY instead of HAVE_TZNAME.
(tzname): Remove declaration.
* modules/nstrftime (Depends-on): Add tzname.
* modules/c-nstrftime (Depends-on): Likewise.
* m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Don't require
AC_STRUCT_TIMEZONE.
* m4/c-nstrftime.m4 (gl_C_GNU_STRFTIME): Likewise.

10 months agoparse-datetime: Support time zone names on MSVC.
Bruno Haible [Thu, 6 Jun 2024 16:22:21 +0000 (18:22 +0200)]
parse-datetime: Support time zone names on MSVC.

* lib/parse-datetime.y (parse_datetime_body): Use HAVE_TZNAME_ARRAY
instead of HAVE_TZNAME. Don't declare tzname.
* modules/parse-datetime (Depends-on): Add tzname.
* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Don't invoke
AC_STRUCT_TIMEZONE.

10 months agotime_rz: Support time zone names on MSVC.
Bruno Haible [Thu, 6 Jun 2024 16:17:23 +0000 (18:17 +0200)]
time_rz: Support time zone names on MSVC.

* lib/time-internal.h: Use HAVE_TZNAME_ARRAY instead of HAVE_TZNAME.
* lib/time_rz.c (tzalloc, save_abbr, mktime_z): Likewise.
* modules/time_rz (Depends-on): Add tzname.
* m4/time_rz.m4 (gl_TIME_RZ): Don't require AC_STRUCT_TIMEZONE.

10 months agotzname: Add tests.
Bruno Haible [Thu, 6 Jun 2024 16:05:57 +0000 (18:05 +0200)]
tzname: Add tests.

* tests/test-tzname.c: New file.
* modules/tzname-tests: New file.

10 months agotzname: New module.
Bruno Haible [Thu, 6 Jun 2024 15:47:21 +0000 (17:47 +0200)]
tzname: New module.

* lib/time.in.h (tzname): New declaration.
* m4/tzname.m4: New file.
* m4/time_h.m4 (gl_TIME_H_REQUIRE_DEFAULTS): Initialize GNULIB_TZNAME.
* modules/time-h (Makefile.am): Substitute GNULIB_TZNAME.
* modules/tzname: New file.
* doc/posix-functions/tzname.texi: Mention the new module.

10 months agotzname, daylight, timezone: Update documentation.
Bruno Haible [Thu, 6 Jun 2024 10:14:46 +0000 (12:14 +0200)]
tzname, daylight, timezone: Update documentation.

* doc/posix-functions/tzname.texi: Update info about native Windows.
* doc/posix-functions/daylight.texi: Update info about OpenBSD, Cygwin,
native Windows.
* doc/posix-functions/timezone.texi: Update info about FreeBSD, OpenBSD,
native Windows.

10 months agoacl-permissions: Fix test-file-has-acl-2.sh failure on Cygwin.
Bruno Haible [Thu, 6 Jun 2024 05:01:00 +0000 (07:01 +0200)]
acl-permissions: Fix test-file-has-acl-2.sh failure on Cygwin.

* lib/acl-internal.c (acl_access_nontrivial): On Cygwin, ignore also
group:Users:* entries.

10 months agognulib-tool.py: Don't perform unnecessary configure.ac scanning.
Collin Funk [Thu, 6 Jun 2024 03:21:51 +0000 (20:21 -0700)]
gnulib-tool.py: Don't perform unnecessary configure.ac scanning.

* pygnulib/GLImport.py (GLImport.execute): Use re.search() instead of
re.findall() since we only care about finding one match. Remove
unnecessary bool() calls.

10 months agosetenv: On native Windows, don't modify _environ directly.
Bruno Haible [Thu, 6 Jun 2024 00:33:41 +0000 (02:33 +0200)]
setenv: On native Windows, don't modify _environ directly.

* m4/setenv.m4 (gl_PREREQ_SETENV): Check for _putenv.
* lib/setenv.c: On native Windows, include <windows.h> and define
SetEnvironmentVariable.
(setenv) [HAVE_DECL__PUTENV]: New implementation for platforms with
_putenv.
* modules/setenv (Depends-on): Add malloc-posix.

10 months agounsetenv: On native Windows, don't modify _environ directly.
Bruno Haible [Wed, 5 Jun 2024 23:21:28 +0000 (01:21 +0200)]
unsetenv: On native Windows, don't modify _environ directly.

* m4/setenv.m4 (gl_PREREQ_UNSETENV): Check for _putenv.
* lib/unsetenv.c (unsetenv): Add native Windows handling, from
lib/putenv.c.
* modules/unsetenv (Depends-on): Add free-posix, malloc-posix.
* m4/putenv.m4 (gl_FUNC_PUTENV): Use AC_CHECK_DECLS_ONCE.
* lib/putenv.c (_unsetenv): Moved to lib/unsetenv.c.
(putenv): Invoke unsetenv instead of _unsetenv.
* modules/putenv-gnu (Depends-on): Add unsetenv.