Log

Author Commit Date CI Message
Collin Funk 83dd4db8 2024-05-18T06:36:55 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 036cabf6 2024-05-18T22:53:28 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 3a5f5178 2024-05-18T21:32:01 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 221d0264 2024-05-18T07:48:47 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 59a670d7 2024-05-18T12:31:15 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.
Bruno Haible 1c0b8a75 2024-05-18T12:25:41 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 4d43a918 2024-05-18T00:19:41 endian: Add tests. * tests/test-endian.c: New file. * modules/endian-tests: New file.
Collin Funk 95f7085c 2024-05-18T00:10:33 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.
Bruno Haible 52698e57 2024-05-18T04:11:50 tests: Fix link errors (regression today). * tests/test-execute-child.c (abort): Undefine. * tests/test-spawn-pipe-child.c (abort): Likewise.
Collin Funk f77eb82c 2024-05-17T18:53:51 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.
Bruno Haible 9eae4533 2024-05-18T02:49:02 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.
Bruno Haible e38aef1f 2024-05-18T02:20:59 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.
Bruno Haible 9e4274cc 2024-05-18T01:37:46 Fix ChangeLog typo.
Paul Eggert 3ecc7798 2024-05-17T15:48:33 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.
Bruno Haible 0e1464f6 2024-05-18T00:27:12 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.
Bruno Haible a103189c 2024-05-17T23:33:17 getusershell tests: Fix link error on MSVC. * modules/getusershell-tests (Makefile.am): Link test-getusershell with $(LIBINTL).
Bruno Haible c7eb28f7 2024-05-17T23:08:00 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.
Bruno Haible 7bd833e7 2024-05-17T22:44:56 New module 'test-xfail'. * modules/test-xfail: New file.
Bruno Haible cf692362 2024-05-17T22:05:46 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.
Bruno Haible 35a44817 2024-05-17T18:45:53 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.
Bruno Haible 573ca4af 2024-05-17T15:18:32 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.
Bruno Haible e36cc17f 2024-05-17T12:58:08 stdbit-h: Fix syntax error. * lib/stdbit.in.h (__gl_stdbit_ctzll) [_MSC_VER]: Fix syntax error.
Bruno Haible 395d9389 2024-05-17T12:09:30 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.
Bruno Haible 2deaf1ff 2024-05-17T11:36:47 putenv-gnu: Update documentation. * doc/posix-functions/putenv.texi: Refer also to the glibc documentation. Use the usual doc structure.
Collin Funk fe845345 2024-05-17T02:35:10 doc: Update outdated module name. * doc/ld-version-script.texi (LD Version Scripts): Refer to 'lib-symbol-visibility' instead of 'visibility'.
Collin Funk 73541d45 2024-05-16T23:18:16 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.
Paul Eggert 15cd8edb 2024-05-16T22:40:59 putenv-tests: pacify gcc -Wdiscarded-qualifiers * tests/test-putenv.c (main): Don’t pass a string literal to a function expecting ‘char *’.
Paul Eggert 03ab520e 2024-05-16T22:39:34 alloca-opt-tests: add a ‘volatile’ * tests/test-alloca-opt.c (func) [HAVE_ALLOCA]: Now volatile, to foil whole-program optimization.
Collin Funk c26bdc4c 2024-05-16T20:49:56 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.
Collin Funk 0858943b 2024-05-16T20:37:14 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 46be8fb6 2024-05-16T18:26:50 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.
Collin Funk 4374e4c4 2024-05-16T16:03:48 unsetenv tests: Update module dependencies. * modules/unsetenv-tests (Depends-on): Depend on 'putenv-gnu' instead of the deprecated 'putenv'.
Collin Funk 5d2987e6 2024-05-16T15:56:47 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.
Collin Funk 2cee1154 2024-05-16T01:43:29 putenv: Add tests. * tests/test-putenv.c: New file. * modules/putenv-tests: New file.
Collin Funk 43ca9607 2024-05-15T20:25:38 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.
Bruno Haible 1a016b72 2024-05-16T01:23:39 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.
Bruno Haible 182c7eb4 2024-05-16T01:20:08 stdbit-h: Make it work in C++ mode. * lib/stdbit.in.h: Remove extraneous 'extern "C" {' marker.
Bruno Haible f146bac0 2024-05-16T00:45:15 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 bade7610 2024-05-15T15:14:01 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 4a7ea1b3 2024-05-15T11:21:04 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 ffac7937 2024-05-15T17:05:43 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.
Bruno Haible 767b725a 2024-05-15T12:04:42 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.
Collin Funk 4b65f477 2024-05-15T02:09:26 getusershell: Add tests. * modules/getusershell-tests: New file. * tests/test-getusershell.c: New file.
Collin Funk b2666d32 2024-05-14T23:21:00 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.
Paul Eggert 656cf7d4 2024-05-14T07:42:20 stdbit: fix dependency * modules/stdbit (Depends-on): Add extern-inline.
Karl Berry 15cb70c1 2024-05-14T07:31:01 autoupdate
Paul Eggert 03761581 2024-05-14T07:11:13 Fix another ChangeLog typo.
Bruno Haible 3f2814ea 2024-05-14T11:20:15 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.
Collin Funk 719ce7d3 2024-05-13T21:36:25 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 59325e84 2024-05-13T15:32:04 Fix Changelog typo.
Paul Eggert 1b7e82be 2024-05-13T15:21:55 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.
Bruno Haible 59b39732 2024-05-13T23:46:59 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.
Bruno Haible d7768ff1 2024-05-13T23:13:15 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.
Bruno Haible cebf2950 2024-05-13T23:03:04 config: Document the update script better. * config/srclist-update: Improve comments.
Bruno Haible fa8b9c15 2024-05-13T18:41:04 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.
Paul Eggert 9deb8e88 2024-05-13T09:44:01 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.
Paul Eggert 623b86c0 2024-05-13T09:29:00 doc: update C23 draft ref from n3047 to n3096
Bruno Haible 1b151519 2024-05-13T17:44:06 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 9768940f 2024-05-13T01:18:53 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 1ed2e43a 2024-05-13T01:18:53 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.
Paul Eggert 639bbfb5 2024-05-12T08:18:43 * stdbit_h.m4: Fix first-line comment.
Simon Josefsson 0c52a761 2024-05-12T17:07:30 maintainer-makefile: Silence announce-gen error with GNULIB_REVISION. * top/maint.mk (gnulib-version): Silence git describe on failure.
Bruno Haible 36f53cb2 2024-05-12T15:58:32 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 5c5e2eae 2024-05-12T12:29:38 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 4312df51 2024-05-11T22:30:50 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 6c3614c1 2024-05-11T21:45:12 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 06ff5254 2024-05-11T20:46:12 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.
Bruno Haible c6b8a003 2024-05-12T04:03:27 Continue to use spaces for indentation, not tabs. * lib/strftime.c: Untabify. Correct indentation. * tests/test-posix_memalign.c: Untabify.
Bruno Haible 99b6e70f 2024-05-11T23:21:08 error-h: Avoid namespace pollution on mingw. * lib/error.in.h: Don't include mingw's <error.h>.
Paul Eggert 945d317c 2024-05-11T11:23:34 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 fe62745d 2024-05-10T10:54:43 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.
Paul Eggert 202261b5 2024-05-09T17:41:19 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.
Paul Eggert 4de6323d 2024-05-09T17:36:10 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.
Bruno Haible 9f7f1b92 2024-05-11T14:39:22 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.
Bruno Haible 8889ae5e 2024-05-11T14:27:02 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 3db26a28 2024-05-11T00:58:44 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 f2632493 2024-05-09T16:30:01 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.
Bruno Haible 65bd9795 2024-05-09T15:06:40 free tests: Avoid test failure with ASAN. * tests/test-free.c (main): Skip mmap/munmap based test if ASAN is enabled.
Bruno Haible 148939f9 2024-05-09T14:01:10 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 c61c0388 2024-05-09T12:56:55 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.
Bruno Haible 9cb82ab3 2024-05-09T12:20:36 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.
Collin Funk ee4be398 2024-05-08T18:55:51 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 b74259a7 2024-05-09T01:41:52 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.
Bruno Haible d4b836cb 2024-05-09T01:25:15 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.
Bruno Haible 07e4eeaf 2024-05-08T11:11:12 gnulib-tool.py: Make --megatest behaviour more similar to shell impl. * pygnulib/main.py (main) [megatest]: Remove space from the testdir name.
Bruno Haible 06287e49 2024-05-08T10:55:43 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.
Collin Funk 17b859fb 2024-05-08T01:24:09 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.
Collin Funk 0b46cf28 2024-05-07T21:47:17 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.
Collin Funk e91650b1 2024-05-07T17:10:23 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().
Paul Eggert af570521 2024-05-07T10:49:14 * doc/posix-headers/utmpx.texi: Update for glibc.
Paul Eggert 4121ae7a 2024-05-07T09:19:17 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.
Simon Josefsson aacceb6e 2024-05-06T15:01:10 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.
Simon Josefsson 2adbe3be 2024-05-06T14:56:08 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.
Bruno Haible 655328ba 2024-05-05T16:30:10 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.
Collin Funk 987535a1 2024-05-04T23:46:02 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.
Bruno Haible fde88b71 2024-05-04T16:36:06 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.
Collin Funk 284c0ad5 2024-05-04T05:17:45 Fix ChangeLog entry for previous commit.
Collin Funk b86d31ad 2024-05-03T17:26:18 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.
Simon Josefsson 6213c5bd 2024-05-03T08:44:03 maint.mk: Don't fail on ~/.indent.pro, reported by Collin Funk. * top/maint.mk (indent_args): Use --ignore-profile.
Collin Funk cae0e724 2024-05-02T16:57:13 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.