]> Savannah Git Hosting - gnulib.git/log
gnulib.git
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.

10 months agoputenv: Don't crash upon out-of-memory.
Bruno Haible [Thu, 6 Jun 2024 00:24:44 +0000 (02:24 +0200)]
putenv: Don't crash upon out-of-memory.

* lib/putenv.c (_unsetenv): Handle malloc failure.

10 months agoputenv: Improve comments.
Bruno Haible [Wed, 5 Jun 2024 23:08:45 +0000 (01:08 +0200)]
putenv: Improve comments.

* lib/putenv.c (_unsetenv, putenv): Improve comments regarding native
Windows.

10 months agosetenv: Modernize.
Bruno Haible [Wed, 5 Jun 2024 21:59:46 +0000 (23:59 +0200)]
setenv: Modernize.

* lib/setenv.c (__add_to_environ): Remove unnecessary casts.

11 months agonstrftime: Make %c work on native Windows again, part 2.
Bruno Haible [Wed, 5 Jun 2024 16:07:55 +0000 (18:07 +0200)]
nstrftime: Make %c work on native Windows again, part 2.

* lib/strftime.c (__strftime_internal): Fix typo in my previous commit.

11 months agonstrftime: don’t assume <locale.h>
Paul Eggert [Wed, 5 Jun 2024 15:27:55 +0000 (08:27 -0700)]
nstrftime: don’t assume <locale.h>

* lib/strftime.c: Include <locale.h> only if needed, since Emacs
attempts to be portable to platforms lacking <locale.h> so it
avoids localename-unsafe-limited and defines
REQUIRE_GNUISH_STRFTIME_AM_PM to false.

11 months agonstrftime: Make %c work on native Windows again.
Bruno Haible [Wed, 5 Jun 2024 14:32:02 +0000 (16:32 +0200)]
nstrftime: Make %c work on native Windows again.

* lib/strftime.c: Include <locale.h> always. Include <wchar.h> on native
Windows.
(__strftime_internal): On native Windows, inspect the locale name like
hard_locale would do.
* modules/nstrftime (Link): Remove section.
* tests/test-nstrftime.h (locales_test): Disallow alternative that is
not culturally acceptable for French.

11 months agoendian: port better to Android NDK r26
Paul Eggert [Tue, 4 Jun 2024 18:50:07 +0000 (11:50 -0700)]
endian: port better to Android NDK r26

* lib/endian.in.h (be16toh, be32toh, be64toh, htobe16, htobe32)
(htobe64, le16toh, le32toh, le64toh, htole16, htole32, htole64):
When @HAVE_ENDIAN_H@, define each NAME to rpl_NAME so that they
don’t interact incorrectly with system-defined implementations.
Problem reported by Po Lu for Android NDK r26 in:
https://lists.gnu.org/r/bug-gnulib/2024-06/msg00040.html
and this patch is an updated version of Collin Funk’s patch in:
https://lists.gnu.org/r/bug-gnulib/2024-06/msg00041.html

11 months agoboot-time, readutmp: Fix missing MinGW include (regr. 2024-05-24).
Collin Funk [Tue, 4 Jun 2024 18:21:04 +0000 (11:21 -0700)]
boot-time, readutmp: Fix missing MinGW include (regr. 2024-05-24).

Reported by Eli Zaretskii in:
<https://lists.gnu.org/archive/html/bug-gnulib/2024-06/msg00044.html>.

* lib/boot-time.c [_WIN32 && !__CYGWIN__]: Remove unnecessary
<sysinfoapi.h> include. Some systems do not have this header and
<windows.h> should have the correct declarations.
* lib/readutmp.c [_WIN32 && !__CYGWIN__]: Likewise.

11 months agonstrftime: remove dependency on hard-locale
Paul Eggert [Tue, 4 Jun 2024 05:00:59 +0000 (22:00 -0700)]
nstrftime: remove dependency on hard-locale

GNU Emacs would rather keep dependencies to a minimum,
and hard-locale brings in some other stuff.
* lib/strftime.c: Include locale.h only if (USE_C_LOCALE &&
HAVE_STRFTIME_L) || ((defined __NetBSD__ || defined __sun) &&
REQUIRE_GNUISH_STRFTIME_AM_PM). Do not include hard-locale.h.
(libc_hidden_def): On native MS-Windows, use the C locale %c
format regardless of language.  I hope that’s good enough.
If not, let’s try to think of a way of solving the problem
that doesn’t require using hard_locale.
* modules/nstrftime (Depends-on): Remove hard-locale.
* modules/nstrftime-tests (test_nstrftime_LDADD):
Remove $(HARD_LOCALE_LIB).
* tests/test-nstrftime.h (locales_test):
Add a test that I hope works on French MS-Windows.

11 months agoieee754-h: port to Android NDK r26
Paul Eggert [Tue, 4 Jun 2024 05:00:58 +0000 (22:00 -0700)]
ieee754-h: port to Android NDK r26

Problem reported by Po Lu in:
https://lists.gnu.org/r/bug-gnulib/2024-06/msg00015.html
* lib/ieee754.in.h (_IEEE754_BYTE_ORDER, _IEEE754_BIG_ENDIAN)
(_IEEE754_LITTLE_ENDIAN, _IEEE754_FLOAT_WORD_ORDER): New macros.
All uses of __BYTE_ORDER, __BIG_ENDIAN, __LITTLE_ENDIAN,
__FLOAT_WORD_ORDER changed to use these new macros.
[!_GL_GNULIB_HEADER]: Include bits/endian.h, not endian.h,
as that’s what glibc does now.
[_GL_GNULIB_HEADER]: Include endian.h instead of rolling our own.
(__BEGIN_DECLS, __END_DECLS): Remove.  All uses replaced
by definiens.
* modules/ieee754-h (Depends-on): Add endian.

11 months agoreadlinkat: Work around a Cygwin 3.3.6 bug.
Bruno Haible [Tue, 4 Jun 2024 01:59:37 +0000 (03:59 +0200)]
readlinkat: Work around a Cygwin 3.3.6 bug.

* m4/readlinkat.m4 (gl_FUNC_READLINKAT): Set REPLACE_READLINKAT to 1 on
Cygwin.
* lib/readlinkat.c (rpl_readlinkat): On Cygwin, for /dev/* files, don't
return results that start with a backslash.
* doc/posix-functions/readlinkat.texi: Mention the Cygwin bug.

11 months agoreadlink: Work around a Cygwin 3.3.6 bug.
Bruno Haible [Mon, 3 Jun 2024 23:48:04 +0000 (01:48 +0200)]
readlink: Work around a Cygwin 3.3.6 bug.

* m4/readlink.m4 (gl_FUNC_READLINK): Set REPLACE_READLINK to 1 on Cygwin.
* lib/readlink.c (rpl_readlink): On Cygwin, for /dev/* files, don't
return results that start with a backslash.
* tests/test-readlink.h (test_readlink): Add a test of /dev/null.
* tests/test-canonicalize-lgpl.c (main): Likewise.
* tests/test-canonicalize.c (main): Likewise.
* doc/posix-functions/readlink.texi: Mention the Cygwin bug.

11 months agoflock tests: Don't expect a failure on native Windows.
Bruno Haible [Mon, 3 Jun 2024 20:16:43 +0000 (22:16 +0200)]
flock tests: Don't expect a failure on native Windows.

* modules/flock-tests (Depends-on): Add test-xfail.
(Makefile.am): Don't augment XFAIL_TESTS on native Windows.

11 months agonstrftime, c-nstrftime tests: Avoid some failures on native Windows.
Bruno Haible [Mon, 3 Jun 2024 18:07:03 +0000 (20:07 +0200)]
nstrftime, c-nstrftime tests: Avoid some failures on native Windows.

* tests/test-nstrftime.h (TZ): Use time zone names that are supported by
native Windows.
(LT): Disable two more tests on native Windows.

11 months agoattribute: improve comments
Paul Eggert [Mon, 3 Jun 2024 16:58:27 +0000 (09:58 -0700)]
attribute: improve comments

* lib/attribute.h: Update comments to better reflect what
GCC actually does with pure and const functions.

11 months agoacl-permissions: Fix test-file-has-acl-2.sh failure on Cygwin.
Bruno Haible [Mon, 3 Jun 2024 15:20:20 +0000 (17:20 +0200)]
acl-permissions: Fix test-file-has-acl-2.sh failure on Cygwin.

* lib/acl-internal.c: Include <sys/types.h>, <grp.h>, <string.h>.
(acl_access_nontrivial): On Cygwin, ignore group:SYSTEM:*,
group:Administrators:*, mask::* entries.
* doc/acl-resources.txt: Add one more reference.

11 months agodprintf-posix tests: Skip the memory leak test on macOS.
Bruno Haible [Mon, 3 Jun 2024 13:34:21 +0000 (15:34 +0200)]
dprintf-posix tests: Skip the memory leak test on macOS.

* tests/test-dprintf-posix2.c: Skip the test on macOS.
(main): Return a different exit code at each point. Allow 100 KB extra
memory consumption.
* tests/test-dprintf-posix2.sh: Update.

11 months agognulib-tool.py: Use a set to optimize.
Collin Funk [Mon, 3 Jun 2024 11:57:14 +0000 (04:57 -0700)]
gnulib-tool.py: Use a set to optimize.

* pygnulib/GLModuleSystem.py
(GLModule.getAutomakeSnippet_Unconditional): Call set() on the result of
_extract_lib_SOURCES() to ensure computing the difference between
another set is O(n).

11 months agopthread-* tests, regex tests: Prepare for use of 'alarm'.
Bruno Haible [Mon, 3 Jun 2024 10:51:08 +0000 (12:51 +0200)]
pthread-* tests, regex tests: Prepare for use of 'alarm'.

* modules/pthread-cond-tests (configure.ac): Test whether 'alarm' is
declared.
* modules/pthread-mutex-tests (configure.ac): Likewise.
* modules/pthread-once-tests (configure.ac): Likewise.
* modules/pthread-rwlock-tests (configure.ac): Likewise.
* modules/pthread-tss-tests (configure.ac): Likewise.
* modules/regex-tests (configure.ac): Likewise.

11 months agomtx tests: Fix a possible link error.
Bruno Haible [Mon, 3 Jun 2024 10:43:06 +0000 (12:43 +0200)]
mtx tests: Fix a possible link error.

* modules/mtx-tests (Files): Add m4/semaphore.m4.
(configure.ac): Require gl_SEMAPHORE.
(Makefile.am): Link test-mtx with @LIB_SEMAPHORE@.

11 months agopthread-mutex, pthread-rwlock: Fix a compilation error.
Bruno Haible [Mon, 3 Jun 2024 10:30:32 +0000 (12:30 +0200)]
pthread-mutex, pthread-rwlock: Fix a compilation error.

* modules/pthread-mutex-tests (Files): Add m4/semaphore.m4.
(configure.ac): Check for semaphore.h. Require gl_SEMAPHORE.
* modules/pthread-rwlock-tests (Files): Add m4/semaphore.m4.
(configure.ac): Check for semaphore.h. Require gl_SEMAPHORE.

11 months agognulib-tool.py: Refactor duplicated regular expressions.
Collin Funk [Mon, 3 Jun 2024 05:32:39 +0000 (22:32 -0700)]
gnulib-tool.py: Refactor duplicated regular expressions.

* pygnulib/GLModuleSystem.py (_LIB_SOURCES_PATTERN): New variable.
(_extract_lib_SOURCES): New function.
(GLModule.getAutomakeSnippet_Unconditional): Use the new function.
(GLModuleTable.add_dummy): Likewise. Add a second break statement to
stop unnecessary looping.

11 months agoc-strtod, c-strtof, c-strtold: Fix link error on AIX.
Bruno Haible [Sun, 2 Jun 2024 20:35:23 +0000 (22:35 +0200)]
c-strtod, c-strtof, c-strtold: Fix link error on AIX.

* lib/c-strtod.c (newlocale): Undefine before use.

11 months agototalorder*: Avoid compilation error by IBM XL C compiler.
Bruno Haible [Sun, 2 Jun 2024 17:31:46 +0000 (19:31 +0200)]
totalorder*: Avoid compilation error by IBM XL C compiler.

* tests/test-totalorder.h (main) [__IBMC__]: Skip the test.
* tests/test-totalordermag.h (main) [__IBMC__]: Likewise.

11 months agoisnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc.
Bruno Haible [Sun, 2 Jun 2024 16:34:36 +0000 (18:34 +0200)]
isnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc.

* lib/isnanf-nolibm.h (HAVE_ISNANF_NOLIBM): New macro.
* lib/isnand-nolibm.h (HAVE_ISNAND_NOLIBM): New macro.
* lib/isnanl-nolibm.h (HAVE_ISNANL_NOLIBM): New macro.
* lib/math.h (isnanf): Don't define via isnan if HAVE_ISNANF_NOLIBM is
defined.
(isnand): Don't define via isnan if HAVE_ISNAND_NOLIBM is defined.
(isnanl): Don't define via isnan if HAVE_ISNANL_NOLIBM is defined.

11 months agognulib-tool.py: Fix regular expression (regr. today).
Collin Funk [Sun, 2 Jun 2024 12:29:33 +0000 (05:29 -0700)]
gnulib-tool.py: Fix regular expression (regr. today).

* pygnulib/main.py (main) [import]: Match all characters until '#' or
end of line, whichever comes first.

11 months agognulib-tool.py: Fix crash when no ACLOCAL_AMFLAGS is found.
Collin Funk [Sun, 2 Jun 2024 08:06:32 +0000 (01:06 -0700)]
gnulib-tool.py: Fix crash when no ACLOCAL_AMFLAGS is found.

* pygnulib/main.py (main) [import]: Use a regular expression to match
the ACLOCAL_AMFLAGS Makefile.am variable. Properly handle the case where
none is found.

11 months agowindows-once: Improve comments.
Bruno Haible [Sat, 1 Jun 2024 00:31:25 +0000 (02:31 +0200)]
windows-once: Improve comments.

* lib/windows-once.c (glwthread_once): Mention the 'started' field in
the comments.

11 months agowindows-once: Fix race (regression yesterday).
Bruno Haible [Fri, 31 May 2024 17:01:24 +0000 (19:01 +0200)]
windows-once: Fix race (regression yesterday).

* lib/windows-once.h (glwthread_once_t): Change type of inited to LONG.
* lib/windows-once.c (glwthread_once): Increment inited from 1 to 2, to
ensure that DeleteCriticalSection gets invoked only once.

11 months agowindows-once: Simplify.
Bruno Haible [Fri, 31 May 2024 16:45:20 +0000 (18:45 +0200)]
windows-once: Simplify.

* lib/windows-once.c (glwthread_once): Use InterlockedCompareExchange
instead of InterlockedIncrement.

11 months agopthread-once: Fix race in Cygwin workaround implementation.
Bruno Haible [Fri, 31 May 2024 13:25:30 +0000 (15:25 +0200)]
pthread-once: Fix race in Cygwin workaround implementation.

* lib/pthread-once.c (pthread_once): Test the 'done' word after
incrementing num_threads. Make sure to invoke pthread_mutex_destroy
only once.

11 months agopthread-once: Simplify Cygwin workaround implementation.
Bruno Haible [Fri, 31 May 2024 09:19:28 +0000 (11:19 +0200)]
pthread-once: Simplify Cygwin workaround implementation.

* lib/pthread-once.c (pthread_once): Use separate 16-bit words to store
the parts of the state.

11 months agopthread-once: Simplify Cygwin workaround implementation.
Bruno Haible [Thu, 30 May 2024 23:56:49 +0000 (01:56 +0200)]
pthread-once: Simplify Cygwin workaround implementation.

* lib/pthread-once.c (pthread_once): Use _Atomic instead of __sync_*
gcc primitives.

11 months agoassert-h, verify: Fix compilation error with g++ (4.8.5) -std=gnu++11.
Bruno Haible [Thu, 30 May 2024 18:06:58 +0000 (20:06 +0200)]
assert-h, verify: Fix compilation error with g++ (4.8.5) -std=gnu++11.

Reported by Harmen <harmen@stoppels.ch> at
<https://savannah.gnu.org/bugs/index.php?65811>.

* lib/verify.h (static_assert): In C++ mode with g++ < 6 and
-std=gnu++11, define in a way that supports also the 1-argument
invocations and the invocations inside C++ struct and class.

11 months agoendian: Unquote variables that are always defined.
Collin Funk [Thu, 30 May 2024 20:30:25 +0000 (13:30 -0700)]
endian: Unquote variables that are always defined.

* m4/endian.m4 (gl_ENDIAN_H): Unquote $ac_cv_header_endian_h and
$GL_GENERATE_ENDIAN_H.

11 months agoattribute: Try harder to avoid syntax errors.
Bruno Haible [Thu, 30 May 2024 14:33:55 +0000 (16:33 +0200)]
attribute: Try harder to avoid syntax errors.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Define
_GL_ATTRIBUTE_REPRODUCIBLE and _GL_ATTRIBUTE_UNSEQUENCED to empty if
_GL_BRACKET_BEFORE_ATTRIBUTE is defined.

11 months agoattribute: Improve comments.
Bruno Haible [Thu, 30 May 2024 14:47:24 +0000 (16:47 +0200)]
attribute: Improve comments.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Mention each macro name at the
beginning of its commentary.

11 months agoendian: Quote variables that may be undefined (regr. 2024-05-18).
Collin Funk [Thu, 30 May 2024 11:46:29 +0000 (04:46 -0700)]
endian: Quote variables that may be undefined (regr. 2024-05-18).

* m4/endian_h.m4 (gl_ENDIAN_H): Quote variables that are undefined on
some systems or may be defined by the user.

11 months agocall_once: Work around Cygwin 3.5.3 bug.
Bruno Haible [Thu, 30 May 2024 08:55:40 +0000 (10:55 +0200)]
call_once: Work around Cygwin 3.5.3 bug.

* m4/call_once.m4 (gl_FUNC_CALL_ONCE): Require AC_CANONICAL_HOST.
On Cygwin, set REPLACE_CALL_ONCE to 1.
* lib/call_once.c (call_once): On Cygwin, use a cast, to avoid a
compiler warning.
* modules/call_once (Depends-on): Add pthread-once.
* doc/posix-functions/call_once.texi: Mention the Cygwin bug.

11 months agowindows-once: Free allocated resources when done.
Bruno Haible [Thu, 30 May 2024 08:23:22 +0000 (10:23 +0200)]
windows-once: Free allocated resources when done.

Based on an observation regarding Cygwin's pthread_once implementation
by Takashi Yano <takashi.yano@nifty.ne.jp> at
<https://cygwin.com/pipermail/cygwin/2024-January/255182.html> and
<https://cygwin.com/pipermail/cygwin-patches/2024q1/012600.html>

* lib/windows-once.h (glwthread_once_t): Add field 'num_threads'.
(GLWTHREAD_ONCE_INIT): Initialize it to zero.
* lib/windows-once.c (glwthread_once): Increment num_threads while the
thread uses the lock. Let the last thread that uses the lock destroy it.

11 months agoautoupdate
Karl Berry [Wed, 29 May 2024 15:08:39 +0000 (08:08 -0700)]
autoupdate

11 months agocall_once tests: Fix link error on mingw.
Bruno Haible [Wed, 29 May 2024 14:59:59 +0000 (16:59 +0200)]
call_once tests: Fix link error on mingw.

* modules/call_once-tests (Depends-on): Add mtx.

11 months agombfile tests: Avoid test failure on mingw.
Bruno Haible [Wed, 29 May 2024 12:13:33 +0000 (14:13 +0200)]
mbfile tests: Avoid test failure on mingw.

* tests/test-mbfile.c: Include <string.h>, localcharset.h.
(main): Verify that setlocale() has installed an UTF-8 locale.
* modules/mbfile-tests (Depends-on): Add localcharset.

11 months agopthread-once tests: Fix crash on mingw.
Bruno Haible [Wed, 29 May 2024 11:41:20 +0000 (13:41 +0200)]
pthread-once tests: Fix crash on mingw.

* modules/pthread-once-tests (Depends-on): Add pthread-rwlock.

11 months agolock: Work around Cygwin 3.5.3 bug.
Bruno Haible [Wed, 29 May 2024 10:06:46 +0000 (12:06 +0200)]
lock: Work around Cygwin 3.5.3 bug.

* modules/lock (Depends-on): Add pthread-once.

11 months agognulib-tool.py: Don't emit non-ASCII shell output.
Collin Funk [Wed, 29 May 2024 09:35:02 +0000 (02:35 -0700)]
gnulib-tool.py: Don't emit non-ASCII shell output.

Reported by Bruno Haible in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00441.html>.

* pygnulib/GLModuleSystem.py (GLModule.shell_id_chars): Use the re.ASCII
flag for the regular expression.

11 months agognulib-tool.py: Add missing docstring.
Collin Funk [Wed, 29 May 2024 06:26:19 +0000 (23:26 -0700)]
gnulib-tool.py: Add missing docstring.

* pygnulib/GLModuleSystem.py (GLModule.getShellId): Add docstring
forgotten in the previous commit.

11 months agognulib-tool.py: Simplify creation of module shell ids.
Collin Funk [Wed, 29 May 2024 04:55:12 +0000 (21:55 -0700)]
gnulib-tool.py: Simplify creation of module shell ids.

* pygnulib/GLModuleSystem.py (GLModule.shell_id_chars): Remove class
variable.
(GLModule.shell_id_pattern): New class variable.
(GLModule.getShellId): New function.
(GLModule.getShellFunc, GLModule.getShellVar)
(GLModule.getConditionalName): Use it.

11 months agopthread-once: Work around Cygwin 3.5.3 bug.
Bruno Haible [Tue, 28 May 2024 20:35:54 +0000 (22:35 +0200)]
pthread-once: Work around Cygwin 3.5.3 bug.

* m4/pthread-once.m4 (gl_PTHREAD_ONCE): On Cygwin, set
REPLACE_PTHREAD_ONCE to 1.
* lib/pthread-once.c (pthread_once): Add an implementation for Cygwin.
* doc/posix-functions/pthread_once.texi: Mention the Cygwin bug.

11 months agoattribute: const/pure defaults to unsequenced/reproducible
Paul Eggert [Tue, 28 May 2024 15:36:28 +0000 (08:36 -0700)]
attribute: const/pure defaults to unsequenced/reproducible

Also, update the commentary to reflect the fact that unsequenced
and reproducible functions can inspect and update storage
addressed by their arguments, and clarify the business about
returning once, and about REPRODUCIBLE and UNSEQUENCED applying to
pointers to functions and to function types.  It’s not clear that
we should encourage the use of REPRODUCIBLE and UNSEQUENCED yet,
as the support is not there and the likely benefits are small.
* m4/gnulib-common.m4 (_GL_ATTRIBUTE_CONST): Default to
_GL_ATTRIBUTE_UNSEQUENCED if the const attribute is lacking,
as every const function is also unsequenced.
(_GL_ATTRIBUTE_PURE): Similarly, default to _GL_ATTRIBUTE_REPRODUCIBLE
as every pure function is reproducible.

11 months agomaint.mk: Update system header list for #include syntax checks.
Collin Funk [Tue, 28 May 2024 04:35:43 +0000 (21:35 -0700)]
maint.mk: Update system header list for #include syntax checks.

* top/maint.mk (gl_prefer_angle_bracket_headers_): Add byteswap.h,
endian.h, and stdbit.h.

11 months agodoc: Mention byteswap.h as a system header.
Collin Funk [Tue, 28 May 2024 04:26:48 +0000 (21:26 -0700)]
doc: Mention byteswap.h as a system header.

* doc/gnulib-tool.texi (Style of #include statements): Add byteswap.h.

11 months agonstrftime, c-nstrftime tests: Avoid test failures on native Windows.
Bruno Haible [Mon, 27 May 2024 22:35:03 +0000 (00:35 +0200)]
nstrftime, c-nstrftime tests: Avoid test failures on native Windows.

* doc/posix-functions/tzset.texi: Add a reference.
* tests/test-nstrftime.h (TZ): Use time zone names that are supported by
native Windows.
(LT): Disable a test of New Zealand DST.

11 months agonstrftime, c-nstrftime tests: Avoid some failures on native Windows.
Bruno Haible [Mon, 27 May 2024 22:24:02 +0000 (00:24 +0200)]
nstrftime, c-nstrftime tests: Avoid some failures on native Windows.

* tests/test-nstrftime.h (tzalloc_test): Fix typo in last commit.

11 months agonstrftime, c-nstrftime tests: Avoid some failures on native Windows.
Bruno Haible [Mon, 27 May 2024 22:10:42 +0000 (00:10 +0200)]
nstrftime, c-nstrftime tests: Avoid some failures on native Windows.

* tests/test-nstrftime.h (tzalloc_test): On native Windows, ignore
differences in the way the time zone is printed.

11 months agonstrftime, c-nstrftime: Make %r work on native Windows.
Bruno Haible [Mon, 27 May 2024 21:29:36 +0000 (23:29 +0200)]
nstrftime, c-nstrftime: Make %r work on native Windows.

* doc/posix-functions/strftime.texi: Mention the %r problem.
* lib/strftime.c (__strftime_internal): On native Windows, for %r, use
the English AM/PM format.

11 months agonstrftime, c-nstrftime: Make %h work on native Windows.
Bruno Haible [Mon, 27 May 2024 21:17:01 +0000 (23:17 +0200)]
nstrftime, c-nstrftime: Make %h work on native Windows.

* doc/posix-functions/strftime.texi: Mention the %h problem.
* lib/strftime.c (__strftime_internal): On native Windows, for %h, do a
%b directive.

11 months agonstrftime, c-nstrftime: Make %c work on native Windows.
Bruno Haible [Mon, 27 May 2024 21:01:50 +0000 (23:01 +0200)]
nstrftime, c-nstrftime: Make %c work on native Windows.

* doc/posix-functions/strftime.texi: Mention the %c problem.
* lib/strftime.c: Include <locale.h> always. Include hard-locale.h.
(__strftime_internal): For %c, use a subformat that contains the weekday
name (or abbrev.) and the month name (or abbrev.).
* modules/nstrftime (Depends-on): Add hard-locale.
(Link): New section.
* modules/nstrftime-tests (Makefile.am): Link test-nstrftime with
$(HARD_LOCALE_LIB).

11 months agotests: Fix internationalization problems on native Windows.
Bruno Haible [Mon, 27 May 2024 20:33:33 +0000 (22:33 +0200)]
tests: Fix internationalization problems on native Windows.

* doc/posix-functions/setlocale.texi: Clarify the deficiency of
setlocale() on native Windows.
* modules/c-nstrftime-tests (Depends-on): Add setlocale.
* modules/dfa-tests (Depends-on): Likewise.
* modules/hard-locale-tests (Depends-on): Likewise.
* modules/localcharset-tests (Depends-on): Likewise.
* modules/nstrftime-tests (Depends-on): Likewise.

11 months agonstrftime, c-nstrftime tests: Improve debuggability.
Bruno Haible [Mon, 27 May 2024 20:13:28 +0000 (22:13 +0200)]
nstrftime, c-nstrftime tests: Improve debuggability.

* tests/test-nstrftime.h (posixtm_test, tzalloc_test, quarter_test,
errno_test, locales_test): Flush output after every printf invocation.

11 months agoparse-datetime tests: Avoid failure on native Windows.
Bruno Haible [Mon, 27 May 2024 15:42:20 +0000 (17:42 +0200)]
parse-datetime tests: Avoid failure on native Windows.

* tests/test-parse-datetime.c (SOME_TIMEPOINT): New macro.
(main): Use it. On native Windows, use Windows time zone names.
Invoke tzset() after setting TZ.
* doc/posix-functions/gmtime.texi: Mention the native Windows problem.
* doc/posix-functions/localtime.texi: Likewise.

11 months agoautoupdate
Karl Berry [Mon, 27 May 2024 14:40:06 +0000 (07:40 -0700)]
autoupdate

11 months agotests: Don't test on the broken NetBSD 10.0 zh_CN.GB18030 locale.
Bruno Haible [Mon, 27 May 2024 11:13:38 +0000 (13:13 +0200)]
tests: Don't test on the broken NetBSD 10.0 zh_CN.GB18030 locale.

* tests/test-mbrtowc.c (main): Add tests for one-by-one input in the
UTF-8 and GB18030 encodings.
* m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Add a sanity check with mbrtowc.

11 months agoattribute: Support ISO C 23 [[reproducible]] and [[unsequenced]].
Bruno Haible [Mon, 27 May 2024 09:40:13 +0000 (11:40 +0200)]
attribute: Support ISO C 23 [[reproducible]] and [[unsequenced]].

* m4/gnulib-common.m4 (gl_COMMON_BODY): Define _GL_ATTR_reproducible,
_GL_ATTR_unsequenced, _GL_ATTRIBUTE_REPRODUCIBLE,
_GL_ATTRIBUTE_UNSEQUENCED.
* lib/attribute.h (UNSEQUENCED, REPRODUCIBLE): New macros.

11 months agoeuidaccess: Fix test failure on native Windows.
Bruno Haible [Sat, 25 May 2024 13:48:32 +0000 (15:48 +0200)]
euidaccess: Fix test failure on native Windows.

* lib/euidaccess.c: Don't include <io.h>.
(euidaccess): On native Windows, invoke access, not _access.

11 months agomcel tests: Avoid test failures due to broken GB18030 converter.
Bruno Haible [Sat, 25 May 2024 10:39:14 +0000 (12:39 +0200)]
mcel tests: Avoid test failures due to broken GB18030 converter.

* tests/test-mcel.c (main): Fix mistake in last commit.

11 months agomcel tests: Avoid test failures due to broken GB18030 converter.
Bruno Haible [Sat, 25 May 2024 10:27:44 +0000 (12:27 +0200)]
mcel tests: Avoid test failures due to broken GB18030 converter.

* tests/test-mcel.c (main): Skip most GB18030 tests on platforms where
the GB18030 converter is known to be broken.