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

11 months agomcel tests: Fix typo.
Bruno Haible [Sat, 25 May 2024 10:16:53 +0000 (12:16 +0200)]
mcel tests: Fix typo.

* tests/test-mcel.c (main): Increment j instead of i.

11 months agouchar-c23: Speed up mbrtoc32 on Solaris 11.4.
Bruno Haible [Sat, 25 May 2024 10:14:29 +0000 (12:14 +0200)]
uchar-c23: Speed up mbrtoc32 on Solaris 11.4.

* lib/lc-charset-unicode.c (get_converters): Cache the return value.

11 months agotests: Refactor.
Bruno Haible [Sat, 25 May 2024 09:46:11 +0000 (11:46 +0200)]
tests: Refactor.

* tests/test-inttostr.c (main): Report SKIP in the 'if' branch.
* tests/test-quotearg.c (main): Likewise.

11 months agotests: Before declaring a SKIP, test if there were ASSERT failures.
Bruno Haible [Sat, 25 May 2024 09:44:21 +0000 (11:44 +0200)]
tests: Before declaring a SKIP, test if there were ASSERT failures.

* HACKING: Document idiom to use with test_exit_status.
* tests/test-c32isalnum.c (main): If there were ASSERT failures, report
them instead of declaring SKIP.
* tests/test-c32isalpha.c (main): Likewise.
* tests/test-c32isblank.c (main): Likewise.
* tests/test-c32iscntrl.c (main): Likewise.
* tests/test-c32isdigit.c (main): Likewise.
* tests/test-c32isgraph.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32isprint.c (main): Likewise.
* tests/test-c32ispunct.c (main): Likewise.
* tests/test-c32isspace.c (main): Likewise.
* tests/test-c32isupper.c (main): Likewise.
* tests/test-c32isxdigit.c (main): Likewise.
* tests/test-c32rtomb.c (main): Likewise.
* tests/test-c32rtomb-w32.c (main): Likewise.
* tests/test-c32snrtombs.c (main): Likewise.
* tests/test-c32srtombs.c (main): Likewise.
* tests/test-c32stombs.c (main): Likewise.
* tests/test-c32tolower.c (main): Likewise.
* tests/test-c32toupper.c (main): Likewise.
* tests/test-canonicalize.c (main): Likewise.
* tests/test-canonicalize-lgpl.c (main): Likewise.
* tests/test-duplocale.c (main): Likewise.
* tests/test-fbufmode.c (main): Likewise.
* tests/test-fenv-except-state-3.c (main): Likewise.
* tests/test-fenv-except-trapping-1.c (main): Likewise.
* tests/test-fenv-except-trapping-2.c (main): Likewise.
* tests/test-fnmatch.c (main): Likewise.
* tests/test-fnmatch-w32.c (main): Likewise.
* tests/test-fpurge.c (main): Likewise.
* tests/test-freadable.c (main): Likewise.
* tests/test-fseek.c (main): Likewise.
* tests/test-fseeko.c (main): Likewise.
* tests/test-ftell.c (main): Likewise.
* tests/test-ftell3.c (main): Likewise.
* tests/test-ftello.c (main): Likewise.
* tests/test-ftello3.c (main): Likewise.
* tests/test-fwritable.c (main): Likewise.
* tests/test-fwriting.c (main): Likewise.
* tests/test-getrandom.c (main): Likewise.
* tests/test-mbrlen-w32.c (main): Likewise.
* tests/test-mbrtoc16.c (main): Likewise.
* tests/test-mbrtoc16-w32.c (main): Likewise.
* tests/test-mbrtoc32.c (main): Likewise.
* tests/test-mbrtoc32-w32.c (main): Likewise.
* tests/test-mbrtowc-w32.c (main): Likewise.
* tests/test-mbsnrtoc32s.c (main): Likewise.
* tests/test-mbsrtoc32s.c (main): Likewise.
* tests/test-mbstoc32s.c (main): Likewise.
* tests/test-nl_langinfo2.c (main): Likewise.
* tests/test-nstrftime.c (main): Likewise.
* tests/test-passfd.c (main): Likewise.
* tests/test-posix_spawn-script.c (main): Likewise.
* tests/test-posix_spawnp-script.c (main): Likewise.
* tests/test-ptsname.c (main): Likewise.
* tests/test-ptsname_r.c (main): Likewise.
* tests/test-remove.c (main): Likewise.
* tests/test-strfmon_l.c (main): Likewise.
* tests/test-utime.c (main): Likewise.
* tests/test-wcrtomb-w32.c (main): Likewise.
* tests/test-execute-script.c (main): Obey CONTINUE_AFTER_ASSERT better.
* tests/test-spawn-pipe-script.c (main): Likewise.
* tests/test-linkat.c (main): Use the common idiom.

11 months agobyteswap tests: Verify header can be used from C++.
Collin Funk [Sat, 25 May 2024 08:20:01 +0000 (01:20 -0700)]
byteswap tests: Verify header can be used from C++.

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

11 months agoreadutmp: Fix dependencies.
Collin Funk [Sat, 25 May 2024 03:59:51 +0000 (20:59 -0700)]
readutmp: Fix dependencies.

* modules/readutmp (Depends-on): Add gettimeofday.

11 months agoboot-time, readutmp: Add a Native Windows boot time fallback.
Collin Funk [Sat, 25 May 2024 02:23:25 +0000 (19:23 -0700)]
boot-time, readutmp: Add a Native Windows boot time fallback.

* lib/boot-time-aux.h (initialize, get_windows_boot_time_fallback): New
functions.
* lib/boot-time.c [_WIN32 && !__CYGWIN__]: Include Windows headers and
<sys/time.h>.
(get_boot_time_uncached): Use the fallback.
* lib/readutmp.c [_WIN32 && !__CYGWIN__]: Include Windows headers and
<sys/time.h>.
(read_utmp_from_file): Use the fallback.
* modules/boot-time (Depends-on): Add gettimeofday.

11 months agoputenv tests: Put the putenv() argument strings into writable memory.
Bruno Haible [Fri, 24 May 2024 10:38:54 +0000 (12:38 +0200)]
putenv tests: Put the putenv() argument strings into writable memory.

* tests/test-putenv.c (main): Declare static variables of type 'char[]',
not 'char *'.

11 months agombrtoc32 tests: Avoid failure on Solaris 11.4 (regression yesterday).
Bruno Haible [Fri, 24 May 2024 09:52:46 +0000 (11:52 +0200)]
mbrtoc32 tests: Avoid failure on Solaris 11.4 (regression yesterday).

* tests/test-mbrtoc32.c (main): Conditionalize an assertion with
GL_CHAR32_T_IS_UNICODE.

11 months agoputenv tests: Silence -Wanalyzer-putenv-of-auto-var.
Collin Funk [Fri, 24 May 2024 05:52:36 +0000 (22:52 -0700)]
putenv tests: Silence -Wanalyzer-putenv-of-auto-var.

* tests/test-putenv.c (main): Declare static variables to pass to
putenv.

11 months agoPOSIX.1-2024 has been approved
Paul Eggert [Fri, 24 May 2024 02:39:29 +0000 (19:39 -0700)]
POSIX.1-2024 has been approved

It hasn’t been published yet, so just update documentation talking
about “draft” POSIX, about particular POSIX versions, etc.
More work will need to be done once it’s published on the web,
to update URLs, better document new and changed interfaces,
and presumably to implement some of the new interfaces.

11 months agombrtoc32: Strengthen tests.
Bruno Haible [Thu, 23 May 2024 21:58:06 +0000 (23:58 +0200)]
mbrtoc32: Strengthen tests.

* tests/test-mbrtoc32.c (main): Add tests for one-by-one input in the
UTF-8 and GB18030 encodings.

11 months agombrtoc32: Work around bug in Cygwin 3.5.3.
Bruno Haible [Thu, 23 May 2024 21:46:52 +0000 (23:46 +0200)]
mbrtoc32: Work around bug in Cygwin 3.5.3.

* m4/mbrtoc32.m4 (gl_MBRTOC32_UTF8_LOCALE): New macro.
(gl_FUNC_MBRTOC32): Invoke it. If mbrtoc32 has this bug, define
MBRTOC32_MULTIBYTE_LOCALE_BUG and reset LOCALE_ZH_CN to 'none'.
* lib/mbrtoc32.c (mbrtoc32): Test MBRTOC32_MULTIBYTE_LOCALE_BUG.
* doc/posix-functions/mbrtoc32.texi: Mention the Cygwin bug.

11 months agosethostname tests: Avoid test failure on Cygwin.
Bruno Haible [Thu, 23 May 2024 17:13:16 +0000 (19:13 +0200)]
sethostname tests: Avoid test failure on Cygwin.

* tests/test-sethostname2.c (main): On Cygwin, skip the "too long
hostname" test.
* doc/glibc-functions/sethostname.texi: Mention the Cygwin problem.

11 months agoaccess, euidaccess tests: Avoid test failures on Cygwin.
Bruno Haible [Thu, 23 May 2024 15:36:05 +0000 (17:36 +0200)]
access, euidaccess tests: Avoid test failures on Cygwin.

* tests/test-access.h (test_access): On Cygwin, don't test for the
absence of the W_OK permission.

11 months agoc32is*, c32toupper tests: Avoid test failures on Cygwin.
Bruno Haible [Thu, 23 May 2024 15:00:58 +0000 (17:00 +0200)]
c32is*, c32toupper tests: Avoid test failures on Cygwin.

* tests/test-c32isalpha.c (main): Disable tests that fail on
Cygwin 3.5.3.
* tests/test-c32iscntrl.c (main): Likewise.
* tests/test-c32isgraph.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32isprint.c (main): Likewise.
* tests/test-c32ispunct.c (main): Likewise.
* tests/test-c32toupper.c (main): Likewise.

11 months agopoll tests: Avoid test failure on Cygwin.
Bruno Haible [Thu, 23 May 2024 14:25:01 +0000 (16:25 +0200)]
poll tests: Avoid test failure on Cygwin.

* tests/test-poll.c (test_pipe): Disable the POLLHUP check also on
Cygwin.
* doc/posix-functions/poll.texi: Mention also Cygwin w.r.t. POLLHUP.

11 months agopassfd tests: Mark as expected failure on Cygwin.
Bruno Haible [Thu, 23 May 2024 13:41:52 +0000 (15:41 +0200)]
passfd tests: Mark as expected failure on Cygwin.

* tests/test-passfd.c (main): Always fail on Cygwin.
* modules/passfd-tests (Depends-on): Add test-xfail.
(Makefile.am): Expect that test-passfd fails on Cygwin.

11 months agorenameatu: Work around Cygwin 3.4.6 bug.
Bruno Haible [Thu, 23 May 2024 13:15:40 +0000 (15:15 +0200)]
renameatu: Work around Cygwin 3.4.6 bug.

* m4/renameat.m4 (gl_FUNC_RENAMEAT): Test whether renameat2 works, and
define HAVE_WORKING_RENAMEAT2 if so.
* lib/renameatu.c (renameatu): Test HAVE_WORKING_RENAMEAT2 instead of
HAVE_RENAMEAT2.
* doc/glibc-functions/renameat2.texi: Mention the Cygwin bug.

11 months agoreadlinkat, areadlinkat: Avoid test failures on Cygwin 3.4.6.
Bruno Haible [Thu, 23 May 2024 10:47:00 +0000 (12:47 +0200)]
readlinkat, areadlinkat: Avoid test failures on Cygwin 3.4.6.

* tests/test-readlink.h (test_readlink): For an empty file name, allow
errno == EBADF.
* tests/test-areadlink.h (test_areadlink): Likewise.

11 months agodoc: Small updates regarding Cygwin.
Bruno Haible [Thu, 23 May 2024 10:16:59 +0000 (12:16 +0200)]
doc: Small updates regarding Cygwin.

* doc/glibc-functions/fallocate.texi: Update for Cygwin 3.5.x.
* doc/posix-functions/c8rtomb.texi: Likewise.
* doc/posix-functions/c16rtomb.texi: Likewise.
* doc/posix-functions/c32rtomb.texi: Likewise.
* doc/posix-functions/lseek.texi: Likewise.
* doc/posix-functions/mbrtoc8.texi: Likewise.
* doc/posix-functions/mbrtoc16.texi: Likewise.
* doc/posix-functions/mbrtoc32.texi: Likewise.
* doc/posix-functions/posix_spawnp.texi: Likewise.

11 months agoiconv: Reject the broken macOS 14.4 iconv implementation.
Bruno Haible [Wed, 22 May 2024 23:10:18 +0000 (01:10 +0200)]
iconv: Reject the broken macOS 14.4 iconv implementation.

Reported by Daniel Collins <solemnwarning@solemnwarning.net> at
<https://savannah.gnu.org/bugs/?65686>.

* m4/iconv.m4 (AM_ICONV_LINK): In the test "for working iconv", test
against the macOS 14.4 iconv bug.
* doc/posix-functions/iconv.texi: Document the bug.

11 months agostdlib: Handle glibc special invocation conventions correctly.
Bruno Haible [Wed, 22 May 2024 22:53:39 +0000 (00:53 +0200)]
stdlib: Handle glibc special invocation conventions correctly.

* lib/stdlib.in.h: Undefine __need_malloc_and_calloc after doing the

11 months agoc-strtod: include <stdio.h>
Paul Eggert [Wed, 22 May 2024 06:32:14 +0000 (23:32 -0700)]
c-strtod: include <stdio.h>

* lib/c-strtod.c: Include <stdio.h>, since we call sprintf.
Problem found by Oracle Developer Studio 12.6 on Solaris 10.

11 months agogetusershell: Split file by lines instead of spaces.
Collin Funk [Tue, 21 May 2024 23:35:09 +0000 (16:35 -0700)]
getusershell: Split file by lines instead of spaces.

* lib/getusershell.c: Include string.h and filename.h
(GNULIB_GETUSERSHELL_SINGLE_THREAD): Remove conditional to include
unlocked stdio functions that are no longer used.
(readname): Remove function.
(getusershell): Use getline and process the string instead of using
readname. Return the first absolute file name.
* modules/getusershell (Depends-on): Remove unlocked-io-internal.
Add getline and filename.
* doc/multithread.texi (Multithreading Optimizations): Don't mention
GNULIB_GETUSERSHELL_SINGLE_THREAD.

11 months agoboot-time: port to Alpine 3.20.0_rc2
Paul Eggert [Tue, 21 May 2024 22:49:40 +0000 (15:49 -0700)]
boot-time: port to Alpine 3.20.0_rc2

* lib/boot-time-aux.h (get_openbsd_boot_time):
Port to Alpine Linux, which had bogus timestamps on /var/run/utmp.

11 months agotrim tests: Avoid test failure on Solaris 11 OmniOS.
Bruno Haible [Tue, 21 May 2024 21:10:37 +0000 (23:10 +0200)]
trim tests: Avoid test failure on Solaris 11 OmniOS.

* tests/test-trim.c (main): Skip the failing test on Illumos.

11 months agomcel tests: Run the test in several locales.
Bruno Haible [Tue, 21 May 2024 19:20:15 +0000 (21:20 +0200)]
mcel tests: Run the test in several locales.

* tests/test-mcel-1.sh: New file, based on tests/test-mbrtowc-1.sh.
* tests/test-mcel-2.sh: New file, based on tests/test-mbrtowc-2.sh.
* tests/test-mcel-3.sh: New file, based on tests/test-mbrtowc-3.sh.
* tests/test-mcel-4.sh: New file, based on tests/test-mbrtowc-4.sh.
* tests/test-mcel-5.sh: New file, based on tests/test-mbrtowc-5.sh.
* modules/mcel-tests (Files): Add them. Add tests/macros.h,
m4/locale-fr.m4, m4/locale-ja.m4, m4/locale-zh.m4, m4/codeset.m4.
(Depends-on): Remove assert-h.
(configure.ac, Makefile.am): Essentially copy from
modules/mbrtowc-tests.

11 months agoflock tests: Mark as expected failure on Solaris 11.
Bruno Haible [Tue, 21 May 2024 17:52:42 +0000 (19:52 +0200)]
flock tests: Mark as expected failure on Solaris 11.

* modules/flock-tests (Makefile.am): Expect that test-flock fails with
the Gnulib fallback.

11 months agoFix "'gl_CHECK_HEADER_SYS_CDEFS_H' was expanded before it was required".
Bruno Haible [Tue, 21 May 2024 16:31:49 +0000 (18:31 +0200)]
Fix "'gl_CHECK_HEADER_SYS_CDEFS_H' was expanded before it was required".

* m4/sys_cdefs_h.m4 (gl_CHECK_HEADER_SYS_CDEFS_H): Define through
AC_DEFUN_ONCE.

11 months agoaccess, euidaccess tests: Avoid test failure for root user on Solaris.
Bruno Haible [Tue, 21 May 2024 13:32:06 +0000 (15:32 +0200)]
access, euidaccess tests: Avoid test failure for root user on Solaris.

* tests/test-access.h (test_access): On Solaris, for the root user,
don't expect X_OK permissions to be absent.
* doc/posix-functions/access.texi: Mention the Solaris problem.
* doc/glibc-functions/euidaccess.texi: Likewise.

11 months agofnmatch tests: Avoid test failure on OmniOS.
Collin Funk [Tue, 21 May 2024 09:40:14 +0000 (02:40 -0700)]
fnmatch tests: Avoid test failure on OmniOS.

Using the GB18030 locale OmniOS doesn't match U+00D7 MULTIPLICATION SIGN
as a punctuation character.

* tests/test-fnmatch.c (main): Skip the test. Discovered by CI test
using OmniOS r151048 and reproduced on OmniOS r151050.

11 months agovasnprintf: Don't abort for pseudo-denormal arguments on macOS 12.
Bruno Haible [Mon, 20 May 2024 22:33:55 +0000 (00:33 +0200)]
vasnprintf: Don't abort for pseudo-denormal arguments on macOS 12.

Reported by Gaëtan Herfray <g.herfray@gahfy.io> via Erik Blake in
<https://lists.gnu.org/archive/html/bug-m4/2022-03/msg00002.html>
<https://lists.gnu.org/archive/html/bug-gnulib/2022-03/msg00066.html>.

* lib/vasnprintf.c (safe_frexpl): New function.
(decode_long_double, floorlog10l): Invoke it instead of frexpl.

11 months agogetopt-posix: port better to Alpine 3.20.0_rc1
Paul Eggert [Mon, 20 May 2024 21:55:11 +0000 (14:55 -0700)]
getopt-posix: port better to Alpine 3.20.0_rc1

Alpine’s <sys/cdefs.h> is a stub that issues a deprecation #warning.
* m4/getopt.m4 (gl_GETOPT_SUBSTITUTE_HEADER):
* m4/sched_h.m4 (gl_SCHED_H): Use the new macro
gl_CHECK_HEADER_SYS_CDEFS_H instead of checking independently.
* m4/sys_cdefs_h.m4: New file.
* modules/getopt-posix, modules/sched (Files): Add m4/sys_cdefs_h.m4.

11 months agotests: Update expected tests results on NetBSD.
Collin Funk [Mon, 20 May 2024 21:34:11 +0000 (14:34 -0700)]
tests: Update expected tests results on NetBSD.

These tests were fixed by the previous commit.
* modules/fdutimensat-tests (Depends-on): Remove test-xfail.
(Makefile.am): Expect that test-fdutimensat succeeds on NetBSD.
* modules/futimens-tests (Depends-on): Remove test-xfail.
(Makefile.am): Expect that test-futimens succeeds on NetBSD.
* modules/utimens-tests (Depends-on): Remove test-xfail.
(Makefile.am): Expect that test-utimens succeeds on NetBSD.
* modules/utimensat-tests (Depends-on): Remove test-xfail.
(Makefile.am): Expect that test-utimensat succeeds on NetBSD.

11 months agoutimensat, utimens: Work around NetBSD 10.0 bugs.
Collin Funk [Mon, 20 May 2024 21:23:41 +0000 (14:23 -0700)]
utimensat, utimens: Work around NetBSD 10.0 bugs.

* lib/utimens.c (fdutimens): Work around a NetBSD 10.0 UTIME_OMIT bug in
the same way as Linux kernel 2.6.32 and Solaris 11.1.
(lutimens): Likewise.
* lib/utimensat.c (rpl_utimensat): Likewise. Workaround a NetBSD 10.0
bug where invalid tv_nsec values are not rejected in the same way as
Linux kernel 2.6.22.19 on hppa.
* doc/posix-functions/utimensat.texi: Document the invalid tv_nsec bug.

11 months agobyteswap: fix problem on macOS
Paul Eggert [Mon, 20 May 2024 17:10:07 +0000 (10:10 -0700)]
byteswap: fix problem on macOS

* m4/byteswap.m4 (gl_BYTESWAP): Quote a variable that might not
be defined (or the user may have defined it to something with spaces!).
Problem reported by Mattias Engdegård for Emacs on macOS.

11 months agolinkat-tests: fix up assertion-failure changes
Paul Eggert [Mon, 20 May 2024 16:54:26 +0000 (09:54 -0700)]
linkat-tests: fix up assertion-failure changes

* tests/test-linkat.c (main): Don’t lose the failure results of
earlier tests.  Problem found by Coverity.

11 months agodfa: attempt to pacify Coverity
Paul Eggert [Mon, 20 May 2024 16:52:52 +0000 (09:52 -0700)]
dfa: attempt to pacify Coverity

* lib/dfa.c (lex): Use ‘assume’ rather than ‘abort’,
to try to pacify Coverity.
(maybe_disable_superset_dfa): Use ‘assume’ here too, for consistency.
Using ‘assume’ should make the code a tiny bit faster, though
at the cost of having undefined behavior instead of nicely aborting.

11 months ago* m4/byteswap.m4: Add comment about broken C libraries.
Paul Eggert [Mon, 20 May 2024 16:08:27 +0000 (09:08 -0700)]
* m4/byteswap.m4: Add comment about broken C libraries.

11 months agoMake it easy to generate debug info for libbacktrace on macOS.
Bruno Haible [Mon, 20 May 2024 15:17:34 +0000 (17:17 +0200)]
Make it easy to generate debug info for libbacktrace on macOS.

* build-aux/macos-compile: New file.

11 months agostdint: Verify the width of 'long long' before using it as int64_t.
Bruno Haible [Mon, 20 May 2024 11:12:50 +0000 (13:12 +0200)]
stdint: Verify the width of 'long long' before using it as int64_t.

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

* lib/stdint.in.h (gl_int64_t): Verify that the number of bits of
'long long' is 64 before using it.
(gl_uint64_t): Verify that the number of bits of 'unsigned long long'
is 64 before using it.

11 months agogetusershell: Work around musl bugs.
Collin Funk [Sun, 19 May 2024 23:40:34 +0000 (16:40 -0700)]
getusershell: Work around musl bugs.

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

* doc/glibc-functions/getusershell.texi: Mention the musl bug.
* lib/unistd.in.h (getusershell, setusershell, endusershell): Allow the
functions to be declared with the rpl_ prefix.
* m4/getusershell.m4 (gl_FUNC_GETUSERSHELL): Prepare functions to be
replaced on musl systems.
(gl_PREREQ_GETUSERSHELL): New macro.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize
REPLACE_GETUSERSHELL.
* modules/getusershell (Depends-on): Update module conditions to account
for the function being available but replaced by Gnulib.
(configure.ac): Likewise. Invoke gl_PREREQ_GETUSERSHELL.

11 months agoabort-debug: Prefer libbacktrace to execinfo.
Bruno Haible [Sun, 19 May 2024 13:55:21 +0000 (15:55 +0200)]
abort-debug: Prefer libbacktrace to execinfo.

* lib/abort-debug.c: Include <backtrace.h>.
(state): New variable.
(print_stack_trace): Add another implementation.
(_gl_pre_abort, rpl_abort): Also test HAVE_LIBBACKTRACE.
* m4/abort-debug.m4 (gl_ABORT_DEBUG_EARLY): Check for libbacktrace.
Set LIBS, not LDFLAGS.

11 months agomkfifoat: Work around a macOS 14 bug.
Bruno Haible [Sun, 19 May 2024 09:55:13 +0000 (11:55 +0200)]
mkfifoat: Work around a macOS 14 bug.

* m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Also test the case of a dangling
symlink.
* doc/posix-functions/mkfifoat.texi: Mention the macOS bug.

11 months agosha512-buffer: port back to 32-bit-only hosts
Paul Eggert [Sun, 19 May 2024 02:02:48 +0000 (19:02 -0700)]
sha512-buffer: port back to 32-bit-only hosts

Port to platforms lacking 64-bit integers (something that Emacs
still attempts to do, in theory) by adding an u64bswap primitive
to u64.h and using that, instead of using bswap_64.  This fixes a
bug I made in commit 0d45ec7c033c165ad73a6509c7fa84aa67edf4ea
dated Sun Jun 17 14:35:37 2018 -0700.
* lib/sha512.c (SWAP): Use u64bswap, not bswap_64, to port
to older platforms lacking 64-bit integers.
* lib/u64.h: Include stddef.h, for size_t.
Include byteswap.h, for bswap_64 (on platforms with 64-bit int),
bswap_32.
(u64rol): Now a function, not a macro, so that it evaluates
its args only once.
(u64uint32): New typedef.
(u64, u64hilo, u64lo): Use it.
(_GL_U64_MASK32): New macro.
(u64size, u64plus, u64shl, u64shr, u64plus): Use it as needed for
odd platforms where unsigned int is wider than 32 bits.
(u64lt): Return bool, not int.
* modules/u64 (Depends-on): Add byteswap, stdbool.
* tests/test-u64.c (main): Test u64bswap.

11 months agodup3: Update documentation and expected test results.
Collin Funk [Sun, 19 May 2024 00:34:09 +0000 (17:34 -0700)]
dup3: Update documentation and expected test results.

* doc/glibc-functions/dup3.texi: Mention NetBSD bug fixed by the Gnulib
implementation after the previous commit.
* modules/dup3-tests (Depends-on): Remove test-xfail.
(Makefile.am): Don't expect test-dup3 to fail on NetBSD.

11 months agodup3: Fix behavior for equal file descriptors on NetBSD.
Collin Funk [Sat, 18 May 2024 23:34:55 +0000 (16:34 -0700)]
dup3: Fix behavior for equal file descriptors on NetBSD.

* lib/dup3.c (dup3) [__NetBSD__]: Check for equal file descriptors upon
a successful call to dup3. If they are equal fail with errno == EINVAL.

11 months agoendian: Make sure system headers can be included.
Collin Funk [Sat, 18 May 2024 13:36:55 +0000 (06:36 -0700)]
endian: Make sure system headers can be included.

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

* lib/endian.in.h (be16toh, be32toh, be64toh, htobe16, htobe32, htobe64)
(le16toh, le32toh, le64toh, htole16, htole32, htole64): Don't define
functions if the system has working versions.
* m4/endian_h.m4 (gl_ENDIAN_H): Separate checks for stdint types and
proper macro/function definitions.
* modules/endian (Depends-on): Add include_next. Update module
dependency conditions.
(Makefile.am): Perform sed replacements on the header substitute.

11 months agoabort-debug: Integrate with CONTINUE_AFTER_ASSERT.
Bruno Haible [Sat, 18 May 2024 20:53:28 +0000 (22:53 +0200)]
abort-debug: Integrate with CONTINUE_AFTER_ASSERT.

* lib/stdlib.in.h (_gl_pre_abort): New declaration.
* lib/abort-debug.c (_gl_pre_abort): New function.
* tests/macros.h (ASSERT, ASSERT_NO_STDIO): If CONTINUE_AFTER_ASSERT
is 1 and the assertion fails, invoke _gl_pre_abort.

11 months agotests: Support showing all assertion failures, not just the first one.
Bruno Haible [Sat, 18 May 2024 19:32:01 +0000 (21:32 +0200)]
tests: Support showing all assertion failures, not just the first one.

* tests/macros.h (CONTINUE_AFTER_ASSERT): New macro.
(test_exit_status): New variable.
(ASSERT, ASSERT_NO_STDIO): If CONTINUE_AFTER_ASSERT is 1, set
test_exit_status instead of aborting.
* tests/**/test-*.{c,h,cc} (main): Instead of exiting with exit code 0,
exit with exit code test_exit_status.
* tests/test-spawn-pipe-child.c: Undefine CONTINUE_AFTER_ASSERT.
* tests/uninorm/test-nf*.c: Include macros.h.
* tests/uninorm/test-u32-nf*-big.c: Likewise.
* tests/random*.c: Define NO_MAIN_HERE.

11 months agobyteswap: pacify GCC 4.4.7 and older
Paul Eggert [Sat, 18 May 2024 14:48:47 +0000 (07:48 -0700)]
byteswap: pacify GCC 4.4.7 and older

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-05/msg00277.html
* lib/byteswap.in.h (bswap_16, bswap_32, bswap_64):
Compute the mask rather than using long constants like
0xff00000000000000 that may generate bogus warnings.

11 months agoendian tests: Verify that it can be used from C++.
Bruno Haible [Sat, 18 May 2024 10:31:15 +0000 (12:31 +0200)]
endian tests: Verify that it can be used from C++.

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

11 months agoendian: Update doc and strengthen tests.
Bruno Haible [Sat, 18 May 2024 10:25:41 +0000 (12:25 +0200)]
endian: Update doc and strengthen tests.

* doc/glibc-headers/endian.texi: Reference LSB and future POSIX
specifications. Update platforms list.
* tests/test-endian.c: Verify that BYTE_ORDER, LITTLE_ENDIAN, BIG_ENDIAN
can be used in #if.

11 months agoendian: Add tests.
Collin Funk [Sat, 18 May 2024 07:19:41 +0000 (00:19 -0700)]
endian: Add tests.

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

11 months agoendian: New module.
Collin Funk [Sat, 18 May 2024 07:10:33 +0000 (00:10 -0700)]
endian: New module.

* doc/glibc-headers/endian.texi, doc/gnulib-tool.texi: Mention it.
* lib/endian.c: New file.
* lib/endian.in.h: New file.
* m4/endian_h.m4: New file.
* modules/endian: New file.

11 months agotests: Fix link errors (regression today).
Bruno Haible [Sat, 18 May 2024 02:11:50 +0000 (04:11 +0200)]
tests: Fix link errors (regression today).

* tests/test-execute-child.c (abort): Undefine.
* tests/test-spawn-pipe-child.c (abort): Likewise.

11 months agogetusershell tests: Fail if empty lines are returned.
Collin Funk [Sat, 18 May 2024 01:53:51 +0000 (18:53 -0700)]
getusershell tests: Fail if empty lines are returned.

* tests/test-getusershell.c (first_pass): Check the result of malloc.
Make sure '\0' isn't returned from getusershell when there is an empty
line in /etc/shells.

11 months agounistd: Fix compilation error with MSVC in C++ mode.
Bruno Haible [Sat, 18 May 2024 00:49:02 +0000 (02:49 +0200)]
unistd: Fix compilation error with MSVC in C++ mode.

* lib/unistd.in.h (read, write): Use _GL_CXXALIAS_MDA_CAST instead of
_GL_CXXALIAS_MDA.

11 months agostdbit-h: Fix compilation error with MSVC in C++ mode.
Bruno Haible [Sat, 18 May 2024 00:20:59 +0000 (02:20 +0200)]
stdbit-h: Fix compilation error with MSVC in C++ mode.

* lib/stdbit.in.h (_BitScanReverse, _BitScanReverse64, _BitScanForward,
_BitScanForward64, __cpuid, __popcnt, __popcnt64): Declare with a
prototype.
* lib/count-leading-zeros.h (_BitScanReverse, _BitScanReverse64):
Likewise.
* lib/count-trailing-zeros.h (_BitScanForward, _BitScanForward64):
Likewise.
* lib/count-one-bits.h (__cpuid, __popcnt, __popcnt64): Likewise.

11 months agoFix ChangeLog typo.
Bruno Haible [Fri, 17 May 2024 23:37:46 +0000 (01:37 +0200)]
Fix ChangeLog typo.

11 months agobyteswap: port better to limited platforms
Paul Eggert [Fri, 17 May 2024 22:48:33 +0000 (15:48 -0700)]
byteswap: port better to limited platforms

POSIX does not require uint64_t, and the C standard
does not require uint16_t or uint32_t either, so port
to platforms that lack these types.  The POSIX limitation
is the only significant one in practice.  I ran into this
issue when updating Emacs, which still ports to platforms
lacking 64-bit types.
* lib/byteswap.in.h (bswap_16, bswap_32, bswap_64):
Accept and return uint_leastN_t instead of uintN_t,
for portability to non-POSIX hosts that lack uintN_t.
Almost no platforms these days lack the types, but
it’s easy to port so let’s do that.  Also, redo to avoid
unnecssary parentheses, as these are now functions not macros.
(bswap_64): Define only if UINT_LEAST64_MAX, for benefit
of not-quite-C99 platforms.  This is similar to what
bitrotate.h does.
* tests/test-byteswap.c (test_bswap_constant)
(test_bswap_eval_once, test_bswap_double) [!UINT_LEAST64_MAX]:
Do not test 64-bit swaps.

11 months agostdbit-h: Fix leading-zeros/ones functions on 64-bit MSVC.
Bruno Haible [Fri, 17 May 2024 22:27:12 +0000 (00:27 +0200)]
stdbit-h: Fix leading-zeros/ones functions on 64-bit MSVC.

* lib/stdbit.in.h (__gl_stdbit_clzll) [_MSC_VER]: On x86_64, use
_BitScanReverse64.

11 months agogetusershell tests: Fix link error on MSVC.
Bruno Haible [Fri, 17 May 2024 21:33:17 +0000 (23:33 +0200)]
getusershell tests: Fix link error on MSVC.

* modules/getusershell-tests (Makefile.am): Link test-getusershell with
$(LIBINTL).

11 months agotests: Mark tests that fail on NetBSD as expected failures.
Bruno Haible [Fri, 17 May 2024 21:08:00 +0000 (23:08 +0200)]
tests: Mark tests that fail on NetBSD as expected failures.

* modules/dup3-tests (Depends-on): Add test-xfail.
(Makefile.am): Expect that test-dup3 fails on NetBSD.
* modules/fdutimensat-tests (Depends-on): Add test-xfail.
(Makefile.am): Expect that test-fdutimensat fails on NetBSD.
* modules/futimens-tests (Depends-on): Add test-xfail.
(Makefile.am): Expect that test-futimens fails on NetBSD.
* modules/utimens-tests (Depends-on): Add test-xfail.
(Makefile.am): Expect that test-utimens fails on NetBSD.
* modules/utimensat-tests (Depends-on): Add test-xfail.
(Makefile.am): Expect that test-utimensat fails on NetBSD.

11 months agoNew module 'test-xfail'.
Bruno Haible [Fri, 17 May 2024 20:44:56 +0000 (22:44 +0200)]
New module 'test-xfail'.

* modules/test-xfail: New file.

11 months agoNew module 'abort-debug'.
Bruno Haible [Fri, 17 May 2024 20:05:46 +0000 (22:05 +0200)]
New module 'abort-debug'.

* lib/stdlib.in.h (abort): New declaration.
* lib/abort-debug.c: New file.
* m4/abort-debug.m4: New file.
* modules/abort-debug: New file.
* m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize
GNULIB_ABORT_DEBUG.
(gl_STDLIB_H_DEFAULTS): Initialize REPLACE_ABORT.
* modules/stdlib (Makefile.am): Substitute GNULIB_ABORT_DEBUG,
REPLACE_ABORT.

11 months agoexecinfo: Update doc.
Bruno Haible [Fri, 17 May 2024 16:45:53 +0000 (18:45 +0200)]
execinfo: Update doc.

* doc/glibc-headers/execinfo.texi: Mention musl libc.
* doc/glibc-functions/backtrace.texi: Likewise.
* doc/glibc-functions/backtrace_symbols.texi: Likewise.
* doc/glibc-functions/backtrace_symbols_fd.texi: Likewise.

11 months agotests: Fix dependencies to test-framework-sh.
Bruno Haible [Fri, 17 May 2024 13:18:32 +0000 (15:18 +0200)]
tests: Fix dependencies to test-framework-sh.

* modules/argp-tests (Depends-on): Add test-framework-sh.
* modules/argp-version-etc-tests (Depends-on): Likewise.
* modules/dfa-tests (Depends-on): Likewise.
* modules/error-tests (Depends-on): Likewise.
* modules/readtokens-tests (Depends-on): Likewise.
* modules/string-desc-tests (Depends-on): Likewise.
* modules/verror-tests (Depends-on): Likewise.
* modules/xstdopen-tests (Depends-on): Remove test-framework-sh.

11 months agostdbit-h: Fix syntax error.
Bruno Haible [Fri, 17 May 2024 10:58:08 +0000 (12:58 +0200)]
stdbit-h: Fix syntax error.

* lib/stdbit.in.h (__gl_stdbit_ctzll) [_MSC_VER]: Fix syntax error.

11 months agosys_select: Fix compilation error in C++ mode on macOS 13, 14.
Bruno Haible [Fri, 17 May 2024 10:09:30 +0000 (12:09 +0200)]
sys_select: Fix compilation error in C++ mode on macOS 13, 14.

* lib/sys_socket.in.h (select): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.

11 months agoputenv-gnu: Update documentation.
Bruno Haible [Fri, 17 May 2024 09:36:47 +0000 (11:36 +0200)]
putenv-gnu: Update documentation.

* doc/posix-functions/putenv.texi: Refer also to the glibc
documentation. Use the usual doc structure.

11 months agodoc: Update outdated module name.
Collin Funk [Fri, 17 May 2024 09:35:10 +0000 (02:35 -0700)]
doc: Update outdated module name.

* doc/ld-version-script.texi (LD Version Scripts): Refer to
'lib-symbol-visibility' instead of 'visibility'.

11 months agobyteswap: Use __has_builtin portably.
Collin Funk [Fri, 17 May 2024 06:18:16 +0000 (23:18 -0700)]
byteswap: Use __has_builtin portably.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00249.html>.

* lib/byteswap.in.h (_GL_BYTESWAP_HAS_BUILTIN_BSWAP16)
(_GL_BYTESWAP_HAS_BUILTIN_BSWAP32)
(_GL_BYTESWAP_HAS_BUILTIN_BSWAP64): Define using the GCC version or
__has_builtin after checking that it is defined.
(bswap_16, bswap_32, bswap_64): Use the macros.
* modules/byteswap (Depends-on): Add stdbool as a conditional
dependency.

11 months agoputenv-tests: pacify gcc -Wdiscarded-qualifiers
Paul Eggert [Fri, 17 May 2024 05:40:59 +0000 (22:40 -0700)]
putenv-tests: pacify gcc -Wdiscarded-qualifiers

* tests/test-putenv.c (main): Don’t pass a string literal
to a function expecting ‘char *’.

11 months agoalloca-opt-tests: add a ‘volatile’
Paul Eggert [Fri, 17 May 2024 05:39:34 +0000 (22:39 -0700)]
alloca-opt-tests: add a ‘volatile’

* tests/test-alloca-opt.c (func) [HAVE_ALLOCA]:
Now volatile, to foil whole-program optimization.

11 months agobyteswap tests: Strengthen tests.
Collin Funk [Fri, 17 May 2024 03:49:56 +0000 (20:49 -0700)]
byteswap tests: Strengthen tests.

* modules/byteswap-tests (Depends-on): Add stdint.
* tests/test-byteswap.c (test_bswap_constant, test_bswap_eval_once)
(test_bswap_double): New functions.
(main): Use them.

11 months agobyteswap: Use inline functions instead of macros.
Collin Funk [Fri, 17 May 2024 03:37:14 +0000 (20:37 -0700)]
byteswap: Use inline functions instead of macros.

* lib/byteswap.c: New file.
* lib/byteswap.in.h (bswap_16, bswap_32, bswap_64): Use inline functions
instead of macros.
* m4/byteswap.m4 (gl_BYTESWAP): Check that bswap functions can be used
on double values.
* modules/byteswap (Files): Add lib/byteswap.c.
(Depends-on): Add extern-inline and stdint as conditional dependencies.
(Makefile.am): Add lib/byteswap.c to lib_SOURCES.

11 months agognulib-tool.py: Fix return value when exiting with Ctrl-C.
Collin Funk [Fri, 17 May 2024 01:26:50 +0000 (18:26 -0700)]
gnulib-tool.py: Fix return value when exiting with Ctrl-C.

* pygnulib/main.py (main_with_exception_handling): Catch
KeyboardInterrupts and exit with a return code of 1.

11 months agounsetenv tests: Update module dependencies.
Collin Funk [Thu, 16 May 2024 23:03:48 +0000 (16:03 -0700)]
unsetenv tests: Update module dependencies.

* modules/unsetenv-tests (Depends-on): Depend on 'putenv-gnu' instead of
the deprecated 'putenv'.

11 months agoRename module 'putenv' to 'putenv-gnu'.
Collin Funk [Thu, 16 May 2024 22:56:47 +0000 (15:56 -0700)]
Rename module 'putenv' to 'putenv-gnu'.

* modules/putenv-gnu: Renamed from modules/putenv.
(Description): Mention the removal of environment variables.
* modules/putenv-gnu-tests: Renamed from modules/putenv-tests.
* modules/putenv: New file, an indirection to the new module.
* doc/posix-functions/putenv.texi: Mention the new module name.
* NEWS: Mention the change.

11 months agoputenv: Add tests.
Collin Funk [Thu, 16 May 2024 08:43:29 +0000 (01:43 -0700)]
putenv: Add tests.

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

11 months agognulib-tool.py: Don't print tracebacks when Ctrl-C is pressed.
Collin Funk [Thu, 16 May 2024 03:25:38 +0000 (20:25 -0700)]
gnulib-tool.py: Don't print tracebacks when Ctrl-C is pressed.

Suggested by Pádraig Brady in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00200.html>.

* pygnulib/main.py (cli_exception): New function.
(main_with_exception_handling): Use it.

11 months agostdbit-h: Add tests.
Bruno Haible [Wed, 15 May 2024 23:23:39 +0000 (01:23 +0200)]
stdbit-h: Add tests.

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

11 months agostdbit-h: Make it work in C++ mode.
Bruno Haible [Wed, 15 May 2024 23:20:08 +0000 (01:20 +0200)]
stdbit-h: Make it work in C++ mode.

* lib/stdbit.in.h: Remove extraneous 'extern "C" {' marker.