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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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().