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

11 months agostdbit-h, stdc_*: New modules, part of the stdbit module.
Bruno Haible [Wed, 15 May 2024 22:45:15 +0000 (00:45 +0200)]
stdbit-h, stdc_*: New modules, part of the stdbit module.

* lib/stdbit.in.h (_GL_STDC_*_INLINE): New macros.
Enclose function definitions in #if @GL_STDC_*@ conditionals.
* lib/stdc_leading_zeros.c: New file.
* lib/stdc_leading_ones.c: New file.
* lib/stdc_trailing_zeros.c: New file.
* lib/stdc_trailing_ones.c: New file.
* lib/stdc_first_leading_zero.c: New file.
* lib/stdc_first_leading_one.c: New file.
* lib/stdc_first_trailing_zero.c: New file.
* lib/stdc_first_trailing_one.c: New file.
* lib/stdc_count_zeros.c: New file.
* lib/stdc_count_ones.c: New file, based on lib/stdbit.c.
* lib/stdc_has_single_bit.c: New file.
* lib/stdc_bit_width.c: New file.
* lib/stdc_bit_floor.c: New file.
* lib/stdc_bit_ceil.c: New file.
* lib/stdbit.c (__gl_stdbit_popcount_support): Remove variable.
* m4/stdbit_h.m4 (gl_STDBIT_H): Initialize GL_STDC_* variables.
* modules/stdbit-h: New file, based on modules/stdbit.
(Depends-on): Add gen-header.
(Makefile.am): Substitute GL_STDC_* variables.
* modules/stdc_leading_zeros: New file.
* modules/stdc_leading_ones: New file.
* modules/stdc_trailing_zeros: New file.
* modules/stdc_trailing_ones: New file.
* modules/stdc_first_leading_zero: New file.
* modules/stdc_first_leading_one: New file.
* modules/stdc_first_trailing_zero: New file.
* modules/stdc_first_trailing_one: New file.
* modules/stdc_count_zeros: New file.
* modules/stdc_count_ones: New file.
* modules/stdc_has_single_bit: New file.
* modules/stdc_bit_width: New file.
* modules/stdc_bit_floor: New file.
* modules/stdc_bit_ceil: New file.
* modules/stdbit: Change to a pure composition module.
* modules/stdc_leading_zeros-tests: New file, based on
modules/stdbit-tests.
* modules/stdc_leading_ones-tests: New file, based on
modules/stdbit-tests.
* modules/stdc_trailing_zeros-tests: New file, based on
modules/stdbit-tests.
* modules/stdc_trailing_ones-tests: New file, based on
modules/stdbit-tests.
* modules/stdc_first_leading_zero-tests: New file, based on
modules/stdbit-tests.
* modules/stdc_first_leading_one-tests: New file, based on
modules/stdbit-tests.
* modules/stdc_first_trailing_zero-tests: New file, based on
modules/stdbit-tests.
* modules/stdc_first_trailing_one-tests: New file, based on
modules/stdbit-tests.
* modules/stdc_count_zeros-tests: New file, based on
modules/stdbit-tests.
* modules/stdc_count_ones-tests: New file, based on
modules/stdbit-tests.
* modules/stdc_has_single_bit-tests: New file, based on
modules/stdbit-tests.
* modules/stdc_bit_width-tests: New file, based on modules/stdbit-tests.
* modules/stdc_bit_floor-tests: New file, based on modules/stdbit-tests.
* modules/stdc_bit_ceil-tests: New file, based on modules/stdbit-tests.
* modules/stdbit-tests: Remove file.
* doc/posix-functions/stdc_leading_zeros.texi: Update.
* doc/posix-functions/stdc_leading_ones.texi: Likewise.
* doc/posix-functions/stdc_trailing_zeros.texi: Likewise.
* doc/posix-functions/stdc_trailing_ones.texi: Likewise.
* doc/posix-functions/stdc_first_leading_zero.texi: Likewise.
* doc/posix-functions/stdc_first_leading_one.texi: Likewise.
* doc/posix-functions/stdc_first_trailing_zero.texi: Likewise.
* doc/posix-functions/stdc_first_trailing_one.texi: Likewise.
* doc/posix-functions/stdc_count_zeros.texi: Likewise.
* doc/posix-functions/stdc_count_ones.texi: Likewise.
* doc/posix-functions/stdc_has_single_bit.texi: Likewise.
* doc/posix-functions/stdc_bit_width.texi: Likewise.
* doc/posix-functions/stdc_bit_floor.texi: Likewise.
* doc/posix-functions/stdc_bit_ceil.texi: Likewise.

11 months agostdbit: tweak first_leading for GCC
Paul Eggert [Wed, 15 May 2024 22:14:01 +0000 (15:14 -0700)]
stdbit: tweak first_leading for GCC

* lib/stdbit.in.h (stdc_first_leading_zero)
(stdc_first_leading_one, stdc_first_trailing_zero_uc)
(stdc_first_trailing_one_uc): Redo to avoid the need for a
conditional branch, at least on x86-64 with GCC 14.

11 months agostdbit: tweak for non-GCC non-Clang
Paul Eggert [Wed, 15 May 2024 18:21:04 +0000 (11:21 -0700)]
stdbit: tweak for non-GCC non-Clang

* lib/stdbit.in.h (__gl_stdbit_clz, __gl_stdbit_clzl)
(__gl_stdbit_clzll, __gl_stdbit_ctz, __gl_stdbit_ctzl)
(__gl_stdbit_ctzll): Work even if the argument is zero.
All callers changed.  This should help avoid branches
on non-GCC-like platforms.

11 months agovasnprintf: Avoid a dummy memory allocation.
Bruno Haible [Wed, 15 May 2024 15:05:43 +0000 (17:05 +0200)]
vasnprintf: Avoid a dummy memory allocation.

* lib/vasnprintf.c (NOMEM_PTR): New macro.
(multiply, divide): Return it instead of NULL in case of memory
allocation failure.
(scale10_round_decimal_decoded): Update.

11 months agogetusershell tests: Verify the function declarations.
Bruno Haible [Wed, 15 May 2024 10:04:42 +0000 (12:04 +0200)]
getusershell tests: Verify the function declarations.

* tests/test-getusershell.c: Include signature.h.
(getusershell, setusershell, endusershell): Check the signatures.
* modules/getusershell-tests (Files): Add tests/signature.h.

11 months agogetusershell: Add tests.
Collin Funk [Wed, 15 May 2024 09:09:26 +0000 (02:09 -0700)]
getusershell: Add tests.

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

11 months agognulib-tool.sh: Don't continue creating testdirs when destdir exists.
Collin Funk [Wed, 15 May 2024 06:21:00 +0000 (23:21 -0700)]
gnulib-tool.sh: Don't continue creating testdirs when destdir exists.

* gnulib-tool.sh (create-testdir, create-megatestdir): Fail if the
destination directory exists instead of creating files and failing to
patch test driver.

11 months agostdbit: fix dependency
Paul Eggert [Tue, 14 May 2024 14:42:20 +0000 (07:42 -0700)]
stdbit: fix dependency

* modules/stdbit (Depends-on): Add extern-inline.

11 months agoautoupdate
Karl Berry [Tue, 14 May 2024 14:31:01 +0000 (07:31 -0700)]
autoupdate

11 months agoFix another ChangeLog typo.
Paul Eggert [Tue, 14 May 2024 14:11:13 +0000 (07:11 -0700)]
Fix another ChangeLog typo.

11 months agognulib-tool.py: Fix formatting of error message in last commit.
Bruno Haible [Tue, 14 May 2024 09:20:15 +0000 (11:20 +0200)]
gnulib-tool.py: Fix formatting of error message in last commit.

* pygnulib/main.py (main_with_exception_handling): Use the usual
formatting of error messages.

11 months agognulib-tool.py: Don't continue creating testdirs when destdir exists.
Collin Funk [Tue, 14 May 2024 04:36:25 +0000 (21:36 -0700)]
gnulib-tool.py: Don't continue creating testdirs when destdir exists.

* pygnulib/GLError.py (GLError.__init__, GLError.__repr__): Add a new
error number for destination directories that already exist.
* pygnulib/main.py (main_with_exception_handling): Print the message.
* pygnulib/GLTestDir.py (GLTestDir.__init__, GLMegaTestdir.__init__):
Fail if the destination directory exists instead of creating files and
failing to patch test driver.

11 months agoFix Changelog typo.
Paul Eggert [Mon, 13 May 2024 22:32:04 +0000 (15:32 -0700)]
Fix Changelog typo.

11 months agostdbit: redo clzll without lookcup table
Paul Eggert [Mon, 13 May 2024 22:21:55 +0000 (15:21 -0700)]
stdbit: redo clzll without lookcup table

* lib/stdbit.c (__gl_stdbit_clztab):
* lib/stdbit.in.h (__gl_stdbit_clzll):
[!_GL_STDBIT_HAS_BUILTIN_CLZ && !_MSC_VER]: Rewrite to avoid the
need for a lookup table in memory, and remove the lookup table.
Do this by shrinking the table to 64 bits and puttiung in a 64-bit
constant.  Although this needs another round of shifts, it avoids
the need for a multiplication and memory access a la de Bruijn,
and is probably a win.

11 months agostdbit tests: Adhere better to Gnulib naming conventions.
Bruno Haible [Mon, 13 May 2024 21:46:59 +0000 (23:46 +0200)]
stdbit tests: Adhere better to Gnulib naming conventions.

* tests/from-glibc/tst-stdc_bit_ceil.c: Renamed from
tests/tst-stdc_bit_ceil.c.
* tests/from-glibc/tst-stdc_bit_floor.c: Renamed from
tests/tst-stdc_bit_floor.c.
* tests/from-glibc/tst-stdc_bit_width.c: Renamed from
tests/tst-stdc_bit_width.c.
* tests/from-glibc/tst-stdc_count_ones.c: Renamed from
tests/tst-stdc_count_ones.c.
* tests/from-glibc/tst-stdc_count_zeros.c: Renamed from
tests/tst-stdc_count_zeros.c.
* tests/from-glibc/tst-stdc_first_leading_one.c: Renamed from
tests/tst-stdc_first_leading_one.c.
* tests/from-glibc/tst-stdc_first_leading_zero.c: Renamed from
tests/tst-stdc_first_leading_zero.c.
* tests/from-glibc/tst-stdc_first_trailing_one.c: Renamed from
tests/tst-stdc_first_trailing_one.c.
* tests/from-glibc/tst-stdc_first_trailing_zero.c: Renamed from
tests/tst-stdc_first_trailing_zero.c.
* tests/from-glibc/tst-stdc_has_single_bit.c: Renamed from
tests/tst-stdc_has_single_bit.c.
* tests/from-glibc/tst-stdc_leading_ones.c: Renamed from
tests/tst-stdc_leading_ones.c.
* tests/from-glibc/tst-stdc_leading_zeros.c: Renamed from
tests/tst-stdc_leading_zeros.c.
* tests/from-glibc/tst-stdc_trailing_ones.c: Renamed from
tests/tst-stdc_trailing_ones.c.
* tests/from-glibc/tst-stdc_trailing_zeros.c: Renamed from
tests/tst-stdc_trailing_zeros.c.
* tests/from-glibc/tst-stdbit.h: Renamed from tests/tst-stdbit.h.
* tests/from-glibc/support/test-driver.c: Renamed from
tests/support/test-driver.c.
* modules/stdbit-tests (Files, Makefile.am): Update.
* config/srclist.txt: Update.

11 months agoconfig: Clarify which destination files have a different basename.
Bruno Haible [Mon, 13 May 2024 21:13:15 +0000 (23:13 +0200)]
config: Clarify which destination files have a different basename.

* config/srclist.txt: Specify the gnulib-side basename in the third
column of a few entries.

11 months agoconfig: Document the update script better.
Bruno Haible [Mon, 13 May 2024 21:03:04 +0000 (23:03 +0200)]
config: Document the update script better.

* config/srclist-update: Improve comments.

11 months agodoc: Document our conventions for *.m4 files.
Bruno Haible [Mon, 13 May 2024 16:41:04 +0000 (18:41 +0200)]
doc: Document our conventions for *.m4 files.

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

* doc/gnulib.texi (Autoconf macros): Document the structure of our *.m4
files.

11 months agostdbit: fix typo in MS-Windows port
Paul Eggert [Mon, 13 May 2024 16:44:01 +0000 (09:44 -0700)]
stdbit: fix typo in MS-Windows port

Problem reported by Mattias Engdegård <https://bugs.gnu.org/70898#8>.
* lib/stdbit.in.h (__gl_stdbit_popcount_support) [_MSC_VER]:
Fix misspelling in decl.

11 months agodoc: update C23 draft ref from n3047 to n3096
Paul Eggert [Mon, 13 May 2024 16:29:00 +0000 (09:29 -0700)]
doc: update C23 draft ref from n3047 to n3096

11 months agodoc: Document <stdbit.h> function-like macros.
Bruno Haible [Mon, 13 May 2024 15:44:06 +0000 (17:44 +0200)]
doc: Document <stdbit.h> function-like macros.
* doc/posix-headers/stdbit.texi: Reference ISO C 23 as the
documentation. Update platforms list.
* doc/posix-functions/stdc_leading_zeros.texi: New file.
* doc/posix-functions/stdc_leading_ones.texi: New file.
* doc/posix-functions/stdc_trailing_zeros.texi: New file.
* doc/posix-functions/stdc_trailing_ones.texi: New file.
* doc/posix-functions/stdc_first_leading_zero.texi: New file.
* doc/posix-functions/stdc_first_leading_one.texi: New file.
* doc/posix-functions/stdc_first_trailing_zero.texi: New file.
* doc/posix-functions/stdc_first_trailing_one.texi: New file.
* doc/posix-functions/stdc_count_zeros.texi: New file.
* doc/posix-functions/stdc_count_ones.texi: New file.
* doc/posix-functions/stdc_has_single_bit.texi: New file.
* doc/posix-functions/stdc_bit_width.texi: New file.
* doc/posix-functions/stdc_bit_floor.texi: New file.
* doc/posix-functions/stdc_bit_ceil.texi: New file.
* doc/gnulib.texi (Function Substitutes): Include them all.

11 months agostdbit: port to theoretical platforms
Paul Eggert [Mon, 13 May 2024 08:18:53 +0000 (01:18 -0700)]
stdbit: port to theoretical platforms

Port to theoretical platforms that C and POSIX allow but are not
likely to ever exist.  This is mostly just to document the existing
source code: when optimizing, the machine code should be largely
unchanged even on platforms lacking __builtin_clz etc.
* lib/stdbit.in.h: Omit static_assert that checks for 8-bit bits.
stdbit-tests checks for this, and omitting the static_assert here
removes a module dependency.
(__gl_stdbit_clzll): Do not limit word size to 128 bits.
(__gl_stdbit_popcount255): Rename from __gl_stdbit_popcount255.
All uses changed.  Do not limit word size to 255 bits.  Correct
bugs on odd theoretical platforms where the word size is not a
power of 2.
* modules/stdbit (Depends-on): Remove assert-h.

11 months agostdbit-tests: make GNULIB_TEST_STDBIT work standalone
Paul Eggert [Mon, 13 May 2024 08:18:53 +0000 (01:18 -0700)]
stdbit-tests: make GNULIB_TEST_STDBIT work standalone

* modules/stdbit-tests (GNULIB_TEST_STDBIT):
Do not define in config.h, since config.h is conditionally
included depending on this macro.
Instead, specify -DGNULIB_TEST_STDBIT in the CPPFLAGS
of each test.

11 months ago* stdbit_h.m4: Fix first-line comment.
Paul Eggert [Sun, 12 May 2024 15:18:43 +0000 (08:18 -0700)]
* stdbit_h.m4: Fix first-line comment.

11 months agomaintainer-makefile: Silence announce-gen error with GNULIB_REVISION.
Simon Josefsson [Sun, 12 May 2024 15:07:30 +0000 (17:07 +0200)]
maintainer-makefile: Silence announce-gen error with GNULIB_REVISION.

* top/maint.mk (gnulib-version): Silence git describe on failure.

11 months agoexecinfo: Document known bugs.
Bruno Haible [Sun, 12 May 2024 13:58:32 +0000 (15:58 +0200)]
execinfo: Document known bugs.

* doc/glibc-functions/backtrace.texi: Mention the various bugs on
FreeBSD, NetBSD, OpenBSD.
* doc/glibc-functions/backtrace_symbols_fd.texi: Mention the glibc bug.

11 months agoexecinfo tests: Strengthen tests.
Bruno Haible [Sun, 12 May 2024 10:29:38 +0000 (12:29 +0200)]
execinfo tests: Strengthen tests.

* tests/test-execinfo.c (test_backtrace): Add an argument. Check the
return value of backtrace(). Check that backtrace_symbols_fd is defined.
Check the return value of backtrace_symbols().
(main): Test also the case of a short buffer.
* modules/execinfo-tests (Makefile.am): Verify that LIB_EXECINFO is
defined.

11 months agostdbit: don’t assume -DHAVE_CONFIG_H
Paul Eggert [Sun, 12 May 2024 05:30:50 +0000 (22:30 -0700)]
stdbit: don’t assume -DHAVE_CONFIG_H

This is needed for diffutils, which doesn’t define HAVE_CONFIG_H.
There needs to be some way for a test shared with glibc to discover
whether it should use the Gnulib or the glibc testing framework,
and I guess this is it.
* modules/stdbit-tests (GNULIB_TEST_STDBIT): Define.
* tests/tst-stdbit.h: Use GNULIB_TEST_STDBIT, not HAVE_CONFIG_H.

11 months agognulib-tool.py: Filter out dependencies that cannot be found.
Collin Funk [Sun, 12 May 2024 04:45:12 +0000 (21:45 -0700)]
gnulib-tool.py: Filter out dependencies that cannot be found.

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

* pygnulib/GLModuleSystem.py (GLModule.getDependenciesWithConditions):
Reorder conditionals to avoid duplicate checks. Filter out None from the
gathered dependencies when gathering module dependencies. Let
GLModuleSystem.find() warn instead of crashing.

11 months agoexecinfo: Add tests.
Collin Funk [Sun, 12 May 2024 03:46:12 +0000 (20:46 -0700)]
execinfo: Add tests.

* modules/execinfo-tests: New file.
* tests/test-execinfo.c (test_backtrace): New function. Simply test that
the symbols defined in execinfo.h can be used.
(main): Use it.

11 months agoContinue to use spaces for indentation, not tabs.
Bruno Haible [Sun, 12 May 2024 02:03:27 +0000 (04:03 +0200)]
Continue to use spaces for indentation, not tabs.

* lib/strftime.c: Untabify. Correct indentation.
* tests/test-posix_memalign.c: Untabify.

11 months agoerror-h: Avoid namespace pollution on mingw.
Bruno Haible [Sat, 11 May 2024 21:21:08 +0000 (23:21 +0200)]
error-h: Avoid namespace pollution on mingw.

* lib/error.in.h: Don't include mingw's <error.h>.

11 months agostdbit: clean up namespace and simplify
Paul Eggert [Sat, 11 May 2024 18:23:34 +0000 (11:23 -0700)]
stdbit: clean up namespace and simplify

Fix namespace pollution in substitute stdbit.h.
Clean up and simplify some of the non-GCC code, by preferring
inline functions to macros and substituting something
more straightforward than a de Bruijn hash (possibly faster?).
The non-GCC non-C23 substitutes should all compile to
branch-free code, if the compiler is good.
* lib/stdbit.c (COUNT_LEADING_ZEROS_INLINE)
(COUNT_TRAILING_ZEROS_INLINE, COUNT_ONE_BITS_INLINE): Remove.
(__gl_stdbit_clztab) [!_GL_STDBIT_HAS_BUILTIN_CLZ && !_MSC_VER]:
New constant array.
(__gl_stdbit_popcount_support): Adjust to stdbit.in.h changes.
* lib/stdbit.in.h: Do not include <limits.h> or <stdlib.h>.
Check that bytes are 8 bits.
(COUNT_LEADING_ZEROS_INLINE, COUNT_TRAILING_ZEROS_INLINE)
(COUNT_ONE_BITS_INLINE, COUNT_LEADING_ZEROS)
(count_leading_zeros_32, count_leading_zeros)
(count_leading_zeros_l, count_leading_zeros_ll)
(COUNT_TRAILING_ZEROS, count_trailing_zeros_32)
(count_trailing_zeros, count_trailing_zeros_l)
(count_trailing_zeros_ll, COUNT_ONE_BITS, count_one_bits_32)
(COUNT_ONE_BITS_GENERIC, count_one_bits, count_one_bits_l)
(count_one_bits_ll): Remove, replacing all uses with ...
(_GL_STDBIT_HAS_BUILTIN_CLZ)
(_GL_STDBIT_HAS_BUILTIN_CTZ, _GL_STDBIT_HAS_BUILTIN_POPCOUNT)
(__gl_stdbit_clz, __gl_stdbit_clzl, __gl_stdbit_clzll)
(__gl_stdbit_ctz, __gl_stdbit_ctzl, __gl_stdbit_ctzll)
(__gl_stdbit_popcount, __gl_stdbit_popcountl, __gl_stdbit_popcountll)
(__gl_stdbit_popcount255): ... these new functions and macros.
(__popcnt64): Omit unnecessary casts.
(__gl_stdbit_popcount_support): Rename from popcount_support
and make it a signed char since that’s all we need.
(__gl_stdbit_popcount_supported): Rename from popcount_supported.
All uses changed.
* modules/stdbit (Depends-on): Add assert-h, for static_assert.

11 months agostdbit: remove most module dependence
Paul Eggert [Fri, 10 May 2024 17:54:43 +0000 (10:54 -0700)]
stdbit: remove most module dependence

Remove dependence of stdbit on the modules count-leading-zeros,
count-trailing-zeros, and count-one-bits.  stdbit is part of C23
and in the long run is more likely to be more portable, so code
should start preferring it.
* lib/stdbit.c (popcount_support): New var, if needed.
* lib/stdbit.in.h: Contain contents of count-leading-zeros.h,
count-trailing-zeros.h, and count-one-bits.h instead of including
those files.  In the long run those files should be stubs that are
implemented via stdbit.
* modules/stdbit (Depends-on): Do not depend on count-leading-zeros,
count-trailing-zeros, count-one-bits.

11 months agostdbit-tests: new module
Paul Eggert [Fri, 10 May 2024 00:41:19 +0000 (17:41 -0700)]
stdbit-tests: new module

* config/srclist.txt: Add files containing stdbit test cases
shared with glibc.
* modules/stdbit-tests: New file.
* tests/support/test-driver.c, tests/tst-stdbit.h:
New files, copied from glibc with changes.
* tests/tst-stdc_bit_ceil.c:
* tests/tst-stdc_bit_floor.c, tests/tst-stdc_bit_width.c:
* tests/tst-stdc_count_ones.c, tests/tst-stdc_count_zeros.c:
* tests/tst-stdc_first_leading_one.c:
* tests/tst-stdc_first_leading_zero.c:
* tests/tst-stdc_first_trailing_one.c:
* tests/tst-stdc_first_trailing_zero.c:
* tests/tst-stdc_has_single_bit.c, tests/tst-stdc_leading_ones.c:
* tests/tst-stdc_leading_zeros.c, tests/tst-stdc_trailing_ones.c:
* tests/tst-stdc_trailing_zeros.c:
New files, copied verbatim from glibc.

11 months agostdbit: new module
Paul Eggert [Fri, 10 May 2024 00:36:10 +0000 (17:36 -0700)]
stdbit: new module

* doc/gnulib-tool.texi, doc/gnulib.texi: Mention it.
* doc/posix-headers/stdbit.texi, lib/stdbit.c, lib/stdbit.in.h:
* m4/stdbit_h.m4, modules/stdbit:
New files.

11 months agodoc: Mention module execinfo.
Bruno Haible [Sat, 11 May 2024 12:39:22 +0000 (14:39 +0200)]
doc: Mention module execinfo.

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

11 months agodoc: Update regarding backtrace functions on *BSD.
Bruno Haible [Sat, 11 May 2024 12:27:02 +0000 (14:27 +0200)]
doc: Update regarding backtrace functions on *BSD.

* doc/glibc-functions/backtrace.texi: Mention in which *BSD releases
this function was missing.
* doc/glibc-functions/backtrace_symbols.texi: Likewise.
* doc/glibc-functions/backtrace_symbols_fd.texi: LIkewise.
* doc/glibc-headers/execinfo.texi: Update *BSD versions.

11 months agodoc: Mention backtrace functions supported on BSD.
Collin Funk [Sat, 11 May 2024 07:58:44 +0000 (00:58 -0700)]
doc: Mention backtrace functions supported on BSD.

* doc/glibc-functions/backtrace.texi (backtrace): Mention that FreeBSD
supports this function from 10.0 onwards. Mention that NetBSD and
OpenBSD support this function from 7.0 onwards.
* doc/glibc-functions/backtrace_symbols.texi (backtrace_symbols):
Likewise.
* doc/glibc-functions/backtrace_symbols_fd.texi (backtrace_symbols_fd):
Likewise.

11 months agounistr/u8-strstr tests: Avoid test failure with ASAN.
Bruno Haible [Thu, 9 May 2024 14:30:01 +0000 (16:30 +0200)]
unistr/u8-strstr tests: Avoid test failure with ASAN.

* tests/unistr/test-u8-strstr.c (main): Increase timeout to 50 sec.
* tests/unistr/test-u16-strstr.c (main): Likewise.
* tests/unistr/test-u32-strstr.c (main): Likewise.

11 months agofree tests: Avoid test failure with ASAN.
Bruno Haible [Thu, 9 May 2024 13:06:40 +0000 (15:06 +0200)]
free tests: Avoid test failure with ASAN.

* tests/test-free.c (main): Skip mmap/munmap based test if ASAN is
enabled.

11 months agoexplicit_bzero, memset_explicit tests: Avoid test failures with ASAN.
Bruno Haible [Thu, 9 May 2024 12:01:10 +0000 (14:01 +0200)]
explicit_bzero, memset_explicit tests: Avoid test failures with ASAN.

* tests/test-explicit_bzero.c (test_heap, test_stack): Define to empty
if ASAN is enabled.
* tests/test-memset_explicit.c (test_heap, test_stack): Likewise.

11 months agodprintf-posix, fprintf-posix: Avoid test failures with ASAN.
Bruno Haible [Thu, 9 May 2024 10:56:55 +0000 (12:56 +0200)]
dprintf-posix, fprintf-posix: Avoid test failures with ASAN.

* tests/test-dprintf-posix2.c (main): Skip the test if ASAN is enabled.
* tests/test-fprintf-posix3.c (main): Likewise.
* tests/test-dprintf-posix2.sh: Update.
* tests/test-fprintf-posix3.sh: Likewise.

11 months agounistdio/*printf: Fix %n handling with module 'printf-with-n-directive'.
Bruno Haible [Thu, 9 May 2024 10:20:36 +0000 (12:20 +0200)]
unistdio/*printf: Fix %n handling with module 'printf-with-n-directive'.

* m4/libunistring-base.m4 (gl_LIBUNISTRING_VERSION_CMP): Optimize the
case of VERSION = 999.9.
* modules/unistdio/u8-asnprintf (configure.ac): If module
'printf-with-n-directive' is in use, don't use an installed libunistring
for this module.
* modules/unistdio/u8-asprintf (configure.ac): Likewise.
* modules/unistdio/u8-snprintf (configure.ac): Likewise.
* modules/unistdio/u8-sprintf (configure.ac): Likewise.
* modules/unistdio/u8-vasnprintf (configure.ac): Likewise.
* modules/unistdio/u8-vasprintf (configure.ac): Likewise.
* modules/unistdio/u8-vsnprintf (configure.ac): Likewise.
* modules/unistdio/u8-vsprintf (configure.ac): Likewise.
* modules/unistdio/u8-u8-asnprintf (configure.ac): Likewise.
* modules/unistdio/u8-u8-asprintf (configure.ac): Likewise.
* modules/unistdio/u8-u8-snprintf (configure.ac): Likewise.
* modules/unistdio/u8-u8-sprintf (configure.ac): Likewise.
* modules/unistdio/u8-u8-vasnprintf (configure.ac): Likewise.
* modules/unistdio/u8-u8-vasprintf (configure.ac): Likewise.
* modules/unistdio/u8-u8-vsnprintf (configure.ac): Likewise.
* modules/unistdio/u8-u8-vsprintf (configure.ac): Likewise.
* modules/unistdio/u16-asnprintf (configure.ac): Likewise.
* modules/unistdio/u16-asprintf (configure.ac): Likewise.
* modules/unistdio/u16-snprintf (configure.ac): Likewise.
* modules/unistdio/u16-sprintf (configure.ac): Likewise.
* modules/unistdio/u16-vasnprintf (configure.ac): Likewise.
* modules/unistdio/u16-vasprintf (configure.ac): Likewise.
* modules/unistdio/u16-vsnprintf (configure.ac): Likewise.
* modules/unistdio/u16-vsprintf (configure.ac): Likewise.
* modules/unistdio/u16-u16-asnprintf (configure.ac): Likewise.
* modules/unistdio/u16-u16-asprintf (configure.ac): Likewise.
* modules/unistdio/u16-u16-snprintf (configure.ac): Likewise.
* modules/unistdio/u16-u16-sprintf (configure.ac): Likewise.
* modules/unistdio/u16-u16-vasnprintf (configure.ac): Likewise.
* modules/unistdio/u16-u16-vasprintf (configure.ac): Likewise.
* modules/unistdio/u16-u16-vsnprintf (configure.ac): Likewise.
* modules/unistdio/u16-u16-vsprintf (configure.ac): Likewise.
* modules/unistdio/u32-asnprintf (configure.ac): Likewise.
* modules/unistdio/u32-asprintf (configure.ac): Likewise.
* modules/unistdio/u32-snprintf (configure.ac): Likewise.
* modules/unistdio/u32-sprintf (configure.ac): Likewise.
* modules/unistdio/u32-vasnprintf (configure.ac): Likewise.
* modules/unistdio/u32-vasprintf (configure.ac): Likewise.
* modules/unistdio/u32-vsnprintf (configure.ac): Likewise.
* modules/unistdio/u32-vsprintf (configure.ac): Likewise.
* modules/unistdio/u32-u32-asnprintf (configure.ac): Likewise.
* modules/unistdio/u32-u32-asprintf (configure.ac): Likewise.
* modules/unistdio/u32-u32-snprintf (configure.ac): Likewise.
* modules/unistdio/u32-u32-sprintf (configure.ac): Likewise.
* modules/unistdio/u32-u32-vasnprintf (configure.ac): Likewise.
* modules/unistdio/u32-u32-vasprintf (configure.ac): Likewise.
* modules/unistdio/u32-u32-vsnprintf (configure.ac): Likewise.
* modules/unistdio/u32-u32-vsprintf (configure.ac): Likewise.
* modules/unistdio/ulc-asnprintf (configure.ac): Likewise.
* modules/unistdio/ulc-asprintf (configure.ac): Likewise.
* modules/unistdio/ulc-fprintf (configure.ac): Likewise.
* modules/unistdio/ulc-snprintf (configure.ac): Likewise.
* modules/unistdio/ulc-sprintf (configure.ac): Likewise.
* modules/unistdio/ulc-vasnprintf (configure.ac): Likewise.
* modules/unistdio/ulc-vasprintf (configure.ac): Likewise.
* modules/unistdio/ulc-vfprintf (configure.ac): Likewise.
* modules/unistdio/ulc-vsnprintf (configure.ac): Likewise.
* modules/unistdio/ulc-vsprintf (configure.ac): Likewise.

11 months agoftello: Prefer stdckdint to intprops.
Collin Funk [Thu, 9 May 2024 01:55:51 +0000 (18:55 -0700)]
ftello: Prefer stdckdint to intprops.

* lib/ftello.c (ftello): Include stdckdint.h instead of intprops.h.
Prefer ckd_add to INT_ADD_OK.
* modules/ftello (Depends-on): Depend on stdckdint instead of intprops.

11 months agosigsegv, c-stack tests: Avoid test failures with ASAN.
Bruno Haible [Wed, 8 May 2024 23:41:52 +0000 (01:41 +0200)]
sigsegv, c-stack tests: Avoid test failures with ASAN.

* tests/test-sigsegv-catch-stackoverflow1.c
(HAVE_STACK_OVERFLOW_RECOVERY): Undefine if ASAN is enabled.
* tests/test-sigsegv-catch-stackoverflow2.c
(HAVE_STACK_OVERFLOW_RECOVERY): Likewise.
* tests/test-c-stack.c (main): Skip the test if ASAN is enabled.

11 months agoargp: Fix test failure with clang's ASAN.
Bruno Haible [Wed, 8 May 2024 23:25:15 +0000 (01:25 +0200)]
argp: Fix test failure with clang's ASAN.

Reported in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-12/msg00035.html>.

* m4/argp.m4 (gl_ARGP): Rename argp_parse to rpl_argp_parse.

11 months agognulib-tool.py: Make --megatest behaviour more similar to shell impl.
Bruno Haible [Wed, 8 May 2024 09:11:12 +0000 (11:11 +0200)]
gnulib-tool.py: Make --megatest behaviour more similar to shell impl.

* pygnulib/main.py (main) [megatest]: Remove space from the testdir
name.

11 months agognulib-tool: In --megatestdir mode, stop when there is an error.
Bruno Haible [Wed, 8 May 2024 08:55:43 +0000 (10:55 +0200)]
gnulib-tool: In --megatestdir mode, stop when there is an error.

* gnulib-tool.sh (megatest): Fail when one of the 'configure' or 'make'
steps fails.
* pygnulib/main.py (main): Likewise.

11 months agognulib-tool.py: Fix behavior of --test when a subprocess fails.
Collin Funk [Wed, 8 May 2024 08:24:09 +0000 (01:24 -0700)]
gnulib-tool.py: Fix behavior of --test when a subprocess fails.

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

* pygnulib/main.py (main): Use sp.run with check=True so that an
exception is thrown when a process fails. Simply exit if an exception
occurs.

11 months agobase32, base64: Prefer stdckdint to intprops.
Collin Funk [Wed, 8 May 2024 04:47:17 +0000 (21:47 -0700)]
base32, base64: Prefer stdckdint to intprops.

* lib/base32.c (base32_encode_alloc): Include stdckdint.h. Prefer
ckd_mul to INT_MULTIPLY_OK.
* lib/base64.c (base64_encode_alloc): Likewise.
* modules/base32 (Depends-on): Add stdckdint.
* modules/base64 (Depends-on): Likewise.

11 months agognulib-tool.py: Handle module dependencies that cannot be found.
Collin Funk [Wed, 8 May 2024 00:10:23 +0000 (17:10 -0700)]
gnulib-tool.py: Handle module dependencies that cannot be found.

* pygnulib/GLModuleSystem.py
(GLModule.getDependenciesWithoutConditions): Filter out None from the
module dependencies. An appropriate warning will already be printed by
GLModuleSystem.find().

11 months ago* doc/posix-headers/utmpx.texi: Update for glibc.
Paul Eggert [Tue, 7 May 2024 17:49:14 +0000 (10:49 -0700)]
* doc/posix-headers/utmpx.texi: Update for glibc.

11 months agonstrftime: use clearer code for padding
Paul Eggert [Tue, 7 May 2024 16:19:17 +0000 (09:19 -0700)]
nstrftime: use clearer code for padding

This also works around GCC bug 114965
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114965>.
* lib/strftime.c (enum pad_style): New type.
(width_add, my_strftime, __strftime_internal):
Use it instead of checking the raw chars.
* tests/test-nstrftime.h (T): Test for the GCC bug.

12 months agomaintainer-makefile: Prohibit BSD4.3/SysV u_char etc types.
Simon Josefsson [Mon, 6 May 2024 13:01:10 +0000 (15:01 +0200)]
maintainer-makefile: Prohibit BSD4.3/SysV u_char etc types.

* top/maint.mk (sc_unsigned_char, sc_unsigned_short)
(sc_unsigned_int, sc_unsigned_long): Add.

12 months agoinet-ntop, inet-pton: Avoid obsolete u_char type.
Simon Josefsson [Mon, 6 May 2024 12:56:08 +0000 (14:56 +0200)]
inet-ntop, inet-pton: Avoid obsolete u_char type.

* lib/inet_pton.c (inet_pton6): Use unsigned char instead of u_char.
* lib/inet_ntop.c: Doc fix.

12 months agognulib-tool.py: Regenerate aclocal.m4 before using 'autoconf -t ...'.
Bruno Haible [Sun, 5 May 2024 14:30:10 +0000 (16:30 +0200)]
gnulib-tool.py: Regenerate aclocal.m4 before using 'autoconf -t ...'.

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

* pygnulib/GLImport.py (GLImport): New field m4dirs.
(GLImport.__init__): Accept an additional m4dirs argument.
(GLImport.execute): Regenerate aclocal.m4 before creating the library
Makefile.
* pygnulib/main.py (main): Pass the guessed_m4dirs to GLImport.

12 months agognulib-tool: Ignore autom4te.cache when using GNULIB_TOOL_IMPL=sh+py.
Collin Funk [Sun, 5 May 2024 06:46:02 +0000 (23:46 -0700)]
gnulib-tool: Ignore autom4te.cache when using GNULIB_TOOL_IMPL=sh+py.

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

* gnulib-tool: Don't compare the autom4te.cache directory since requests
are not sorted in Autoconf version 2.71 and below.

12 months agoreadutmp, boot-time: Work around a Cygwin 3.5.3 bug.
Bruno Haible [Sat, 4 May 2024 14:36:06 +0000 (16:36 +0200)]
readutmp, boot-time: Work around a Cygwin 3.5.3 bug.

Reported by Ken Brown <kbrown@cornell.edu> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00035.html>.

* lib/boot-time-aux.h (get_windows_boot_time): On Cygwin, ignore
pagefile.sys if it appears to be a directory, and use another file as
a fallback.

12 months agoFix ChangeLog entry for previous commit.
Collin Funk [Sat, 4 May 2024 12:17:45 +0000 (05:17 -0700)]
Fix ChangeLog entry for previous commit.

12 months agognulib-tool.py: Fix an undefined function name.
Collin Funk [Sat, 4 May 2024 00:26:18 +0000 (17:26 -0700)]
gnulib-tool.py: Fix an undefined function name.

* pygnulib/main.py (main_with_exception_handling): Use the tempfile
module prefix when calling mkdtemp(). Use the 'glpy' prefix for the
temporary directory that exists for the entirety of the program.

12 months agomaint.mk: Don't fail on ~/.indent.pro, reported by Collin Funk.
Simon Josefsson [Fri, 3 May 2024 06:44:03 +0000 (08:44 +0200)]
maint.mk: Don't fail on ~/.indent.pro, reported by Collin Funk.

* top/maint.mk (indent_args): Use --ignore-profile.

12 months agognulib-tool.sh: Fix program name in error message.
Collin Funk [Thu, 2 May 2024 23:57:13 +0000 (16:57 -0700)]
gnulib-tool.sh: Fix program name in error message.

* gnulib-tool.sh: Use 'gnulib-tool' instead of 'gnulib' as the program
name in the error message.

12 months agoDEPENDENCIES: Add Cygwin as supported platform.
Collin Funk [Thu, 2 May 2024 21:22:14 +0000 (14:22 -0700)]
DEPENDENCIES: Add Cygwin as supported platform.

* DEPENDENCIES: Mention Cygwin as a supported platform for building
Windows binaries.

12 months agodoc: Add appendix about Gnulib history.
Bruno Haible [Thu, 2 May 2024 18:10:14 +0000 (20:10 +0200)]
doc: Add appendix about Gnulib history.

* doc/gnulib-history.texi: New file.
* doc/gnulib.texi: Include it.

12 months agognulib-tool.py: Don't leave temporary directories on exit.
Collin Funk [Thu, 2 May 2024 07:49:58 +0000 (00:49 -0700)]
gnulib-tool.py: Don't leave temporary directories on exit.

* pygnulib/main.py (main_with_exception_handling): Use
tempfile.TemporaryDirectory as a context manager so it is removed before
the program exits.
(main): Expect a temporary directory to be passed as an argument.
* pygnulib/GLConfig.py (GLConfig.__init__): Accept an optional temporary
directory parameter instead of creating one.
* pygnulib/GLImport.py (GLImport.__init__): Don't remove the cache's
temporary directory since it doesn't create one anymore.
(GLImport.execute): Don't remove the temporary directory explicitly. It
is handled by the usage of a context manager.
* pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute):
Likewise.

12 months agognulib-tool.py: Quote file names passed to 'patch'.
Collin Funk [Thu, 2 May 2024 04:26:34 +0000 (21:26 -0700)]
gnulib-tool.py: Quote file names passed to 'patch'.

* pygnulib/GLTestDir.py (_patch_test_driver): Import shlex and cleanup
unused imports. Use shlex.quote() on the file names passed to 'patch'.
* pygnulib/GLFileSystem.py (GLFileSystem.lookup): Likewise. Perform
redirection using sp.call() arguments instead of using the shell.

12 months agoreadutmp, boot-time: Improve for some Cygwin installations.
Bruno Haible [Wed, 1 May 2024 22:52:26 +0000 (00:52 +0200)]
readutmp, boot-time: Improve for some Cygwin installations.

Reported by Ken Brown <kbrown@cornell.edu> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00008.html>.

* lib/boot-time-aux.h (get_windows_boot_time): Use /proc/cygdrive/
instead of /cygdrive/.

12 months agostddef: A better workaround against GCC bug 114870.
Bruno Haible [Wed, 1 May 2024 22:10:21 +0000 (00:10 +0200)]
stddef: A better workaround against GCC bug 114870.

* lib/stddef.in.h: If STDDEF_NOT_IDEMPOTENT is 1, disable the special
invocation convention.
* m4/stddef_h.m4 (gl_STDDEF_H): Set STDDEF_NOT_IDEMPOTENT.
(gl_STDDEF_H_DEFAULTS): Initialize STDDEF_NOT_IDEMPOTENT.
* modules/stddef (Makefile.am): Substitute STDDEF_NOT_IDEMPOTENT.

12 months agostddef: Fix <stddef.h> behaviour on Cygwin (regression 2024-04-27).
Bruno Haible [Wed, 1 May 2024 21:10:51 +0000 (23:10 +0200)]
stddef: Fix <stddef.h> behaviour on Cygwin (regression 2024-04-27).

Reported by Markus Mützel <markus.muetzel@gmx.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00522.html>.

* lib/stddef.in.h: Don't test _@GUARD_PREFIX@_STDDEF_H. Fix comments.

12 months agodoc: Reference a gcc bug.
Bruno Haible [Wed, 1 May 2024 21:07:14 +0000 (23:07 +0200)]
doc: Reference a gcc bug.

* doc/posix-headers/stddef.texi: Reference a gcc bug.

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

12 months agosprintf-posix, snprintf-posix tests: Add comment.
Bruno Haible [Wed, 1 May 2024 10:25:18 +0000 (12:25 +0200)]
sprintf-posix, snprintf-posix tests: Add comment.

Suggested by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00546.html>.

* tests/test-sprintf-posix.h (test_function): Add comment about known
failures.

12 months agognulib-tool.py: Fix mistake in previous commit.
Collin Funk [Wed, 1 May 2024 09:21:43 +0000 (02:21 -0700)]
gnulib-tool.py: Fix mistake in previous commit.

* pygnulib/GLModuleSystem.py (GLModuleSystem.exists)
(GLModuleSystem.find): Rename 'module' argument to 'module_name' so it
is clear they are not a GLModule object. Treat them as such.

12 months agognulib-tool.py: Use the GLModule's name variable directly.
Collin Funk [Wed, 1 May 2024 08:12:18 +0000 (01:12 -0700)]
gnulib-tool.py: Use the GLModule's name variable directly.

* pygnulib/GLModuleSystem.py (GLModule.getName): Remove function.
(GLModule.__str__, GLModule.__repr__, GLModule.isNonTests)
(GLModule.repeatModuleInTests, GLModule.getDependenciesRecursively)
(GLModule.getShellFunc, GLModule.getShellVar)
(GLModule.getConditionalName, GLModule.getApplicability)
(GLModule.getDependencies, GLModule.getAutomakeSnippet_Unconditional)
(GLModule.getLicense, GLModuleSystem.find)
(GLModuleTable.transitive_closure): Use the GLModule's name instance
variable instead of using str() or removed getName() function.
* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippet)
(GLEmiter.preEarlyMacros, GLEmiter.lib_Makefile_am)
(GLEmiter.tests_Makefile_am): Likewise.
* pygnulib/GLImport.py (GLImport.gnulib_comp, GLImport.prepare):
Likewise.
* pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute):
Likewise.

12 months agointprops: document fix for GCC bug 68193
Paul Eggert [Wed, 1 May 2024 02:36:43 +0000 (19:36 -0700)]
intprops: document fix for GCC bug 68193

* lib/intprops-internal.h (_GL__GENERIC_BOGUS):
GCC bug 68193 is fixed in GCC 14.  This is just for documentation,
as _GL__GENERIC_BOGUS is not consulted in GCC 14.

12 months ago*printf: Don't invoke gl_PRINTF_DIRECTIVE_N when it's not needed.
Bruno Haible [Tue, 30 Apr 2024 11:35:50 +0000 (13:35 +0200)]
*printf: Don't invoke gl_PRINTF_DIRECTIVE_N when it's not needed.

* m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_IS_POSIX): Don't require
gl_PRINTF_DIRECTIVE_N if gl_PRINTF_SUPPORT_N_DIRECTIVE is not defined.
* m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_IS_POSIX): Likewise.
* m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_IS_POSIX): Likewise.
* m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_IS_POSIX): Likewise.
* m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_IS_POSIX): Likewise.
* m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_IS_POSIX): Likewise.
* m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_IS_POSIX): Likewise.
* m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_IS_POSIX): Likewise.
* m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_IS_POSIX): Likewise.
* m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_IS_POSIX): Likewise.
* m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_IS_POSIX): Likewise.

12 months ago*printf: Avoid a dialog during 'configure' with MSVC in debug mode.
Bruno Haible [Tue, 30 Apr 2024 11:14:31 +0000 (13:14 +0200)]
*printf: Avoid a dialog during 'configure' with MSVC in debug mode.

Suggested by Paul Harris <harris.pc@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-04/msg00005.html>.

* m4/printf.m4 (gl_PRINTF_DIRECTIVE_N): In the test program, include
<crtdbg.h> and disable the MSVC reporting for assertion failures.

12 months agognulib-tool.py: Remove remaining unused instance variables.
Collin Funk [Tue, 30 Apr 2024 08:09:55 +0000 (01:09 -0700)]
gnulib-tool.py: Remove remaining unused instance variables.

* pygnulib/GLModuleSystem.py (GLModule.__init__)
(GLModuleTable.__init__): Remove the unused GLFileSystem variable. These
classes perform lookups with a GLModuleSystem.
* pygnulib/GLTestDir.py (GLTestDir.__init__): Remove the unused
GLFileAssistant variable. The transformations it performs are not needed
in testdirs.

12 months agognulib-tool.py: Add type hints to classes.
Collin Funk [Tue, 30 Apr 2024 05:20:31 +0000 (22:20 -0700)]
gnulib-tool.py: Add type hints to classes.

* pygnulib/*.py: Add type hints for all instance and class variables.
* pygnulib/GLMakefileTable.py (GLMakefileTable.__getitem__): Fix return
type hint since the dictionary has str values.

12 months agognulib-tool.py: Emit libtests in testdirs generated Makefile.am.
Collin Funk [Tue, 30 Apr 2024 05:15:56 +0000 (22:15 -0700)]
gnulib-tool.py: Emit libtests in testdirs generated Makefile.am.

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

* pygnulib/GLTestDir.py (GLTestDir.execute): Modify the GLEmiter's
config variable instead of the GLTestDir's so that it can be accessed
when emitting the Makefile.am.

12 months agodoc: Update macro list in gnulib-cache.m4 documentation.
Collin Funk [Sun, 28 Apr 2024 22:52:27 +0000 (15:52 -0700)]
doc: Update macro list in gnulib-cache.m4 documentation.

* doc/gnulib-tool.texi (Modified imports): Add missing macros from the
sed invocation in func_import of gnulib-tool.sh.

12 months agodoc: Mention AC_CONFIG_MACRO_DIRS in configure.ac.
Collin Funk [Sun, 28 Apr 2024 11:43:39 +0000 (04:43 -0700)]
doc: Mention AC_CONFIG_MACRO_DIRS in configure.ac.

Document the following gnulib-tool change:
2021-12-19  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Don't insist on ACLOCAL_AMFLAGS.

* doc/gnulib-tool.texi (Initial import): Update the example gnulib-tool
invocation. Document the use of AC_CONFIG_MACRO_DIRS as an alternative
to ACLOCAL_AMFLAGS.

12 months agobootstrap: Support checking out a recent GNULIB_REVISION, part 2.
Bruno Haible [Sun, 28 Apr 2024 09:29:27 +0000 (11:29 +0200)]
bootstrap: Support checking out a recent GNULIB_REVISION, part 2.

Reported by Markus Mützel <markus.muetzel@gmx.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00507.html>.

* top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): If using a submodule
and the 'git checkout' command fails, fetch the newer commits and then
retry it.
* build-aux/bootstrap: Regenerated.

12 months agognulib-tool: Simplify the Python version test.
Bruno Haible [Sat, 27 Apr 2024 18:33:59 +0000 (20:33 +0200)]
gnulib-tool: Simplify the Python version test.

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

* gnulib-tool: Use Python's sys.version_info, not --version.
* gnulib-tool.py: Use the same version test here. Use --version only to
produce a specific error message.

12 months agomaint: be more precise and vague about GCC 14
Paul Eggert [Sat, 27 Apr 2024 23:07:16 +0000 (16:07 -0700)]
maint: be more precise and vague about GCC 14

In commentary, be specific about which particular GCC 14 prerelease is
meant when this matters, and don’t say “GCC 14” otherwise.
Prompted by a remark by Sam James in:
https://lists.gnu.org/r/bug-gnulib/2024-04/msg00484.html