Bruno Haible [Sun, 30 Jun 2024 20:56:15 +0000 (22:56 +0200)]
fzprintf-gnu: Add tests.
* tests/test-fzprintf-gnu.c: New file, based on
tests/test-fprintf-gnu.c.
* tests/test-fzprintf-gnu.sh: New file, based on
tests/test-fprintf-gnu.sh.
* modules/fzprintf-gnu-tests: New file.
Bruno Haible [Sun, 30 Jun 2024 20:42:20 +0000 (22:42 +0200)]
vfzprintf-gnu: Add tests.
* tests/test-vfzprintf-gnu.c: New file, based on
tests/test-vfprintf-gnu.c.
* tests/test-vfzprintf-gnu.sh: New file, based on
tests/test-vfprintf-gnu.sh.
* tests/test-fprintf-gnu.h: Update title.
* modules/vfzprintf-gnu-tests: New file.
Bruno Haible [Sun, 30 Jun 2024 20:23:45 +0000 (22:23 +0200)]
zprintf-posix: Add tests.
* tests/test-zprintf-posix.c: New file, based on
tests/test-printf-posix.c.
* tests/test-zprintf-posix.sh: New file, based on
tests/test-printf-posix.sh.
* modules/zprintf-posix-tests: New file.
Bruno Haible [Sun, 30 Jun 2024 20:12:41 +0000 (22:12 +0200)]
vzprintf-posix: Add tests.
* tests/test-printf-posix.h (test_function): Use RETTYPE instead of
'int'.
* tests/test-printf-posix.c (RETTYPE): New macro.
* tests/test-vprintf-posix.c (RETTYPE): New macro.
* tests/test-xprintf-posix.c (RETTYPE): New macro.
* tests/test-vzprintf-posix.c: New file, based on
tests/test-vprintf-posix.c.
* tests/test-vzprintf-posix.sh: New file, based on
tests/test-vprintf-posix.sh.
* modules/vzprintf-posix-tests: New file.
Bruno Haible [Sun, 30 Jun 2024 19:55:13 +0000 (21:55 +0200)]
fzprintf-posix: Add tests.
* tests/test-fzprintf-posix.c: New file, based on
tests/test-fprintf-posix.c.
* tests/test-fzprintf-posix.sh: New file, based on
tests/test-fprintf-posix.sh.
* modules/fzprintf-posix-tests: New file.
Bruno Haible [Sun, 30 Jun 2024 19:17:03 +0000 (21:17 +0200)]
vfzprintf-posix: Add tests.
* tests/test-vfzprintf-posix.c: New file, based on
tests/test-vfprintf-posix.c.
* tests/test-vfzprintf-posix.sh: New file, based on
tests/test-vfprintf-posix.sh.
* tests/test-fprintf-posix.h: Update title.
* modules/vfzprintf-posix-tests: New file.
Bruno Haible [Sun, 30 Jun 2024 16:31:56 +0000 (18:31 +0200)]
vfzprintf: New module.
* lib/stdio.in.h (vfzprintf): New declaration.
* lib/vfzprintf.c: New file, based on lib/vfprintf.c and
lib/vdzprintf.c.
* m4/stdio_h.m4 (gl_STDIO_H_REQUIRE_DEFAULTS): Initialize
GNULIB_VFZPRINTF.
* modules/stdio (Makefile.am): Substitute GNULIB_VFZPRINTF.
* modules/vfzprintf: New file.
Bruno Haible [Sun, 30 Jun 2024 15:43:45 +0000 (17:43 +0200)]
dzprintf-gnu: Add tests.
* tests/test-dprintf-gnu.h: New file, extracted from
tests/test-dprintf-gnu.c.
* tests/test-dprintf-gnu.c: Include it.
(test_function): Remove function.
* modules/dprintf-gnu-tests (Files): Add it.
* tests/test-dzprintf-gnu.c: New file, based on
tests/test-dprintf-gnu.c.
* tests/test-dzprintf-gnu.sh: New file, based on
tests/test-dprintf-gnu.sh.
* modules/dzprintf-gnu-tests: New file.
Bruno Haible [Sun, 30 Jun 2024 15:29:44 +0000 (17:29 +0200)]
vdzprintf-gnu: Add tests.
* tests/test-fprintf-gnu.h (test_function): Use RETTYPE instead of
'int'.
* tests/test-fprintf-gnu.c (RETTYPE): New macro.
* tests/test-vdprintf-gnu.c (RETTYPE): New macro.
* tests/test-vfprintf-gnu.c (RETTYPE): New macro.
* tests/test-vdzprintf-gnu.c: New file, based on
tests/test-vdzprintf-posix.c.
* tests/test-vdzprintf-gnu.sh: New file, based on
tests/test-vdzprintf-posix.sh.
* modules/vdzprintf-gnu-tests: New file.
Bruno Haible [Sun, 30 Jun 2024 15:25:46 +0000 (17:25 +0200)]
dzprintf-posix: Add tests.
* tests/test-dprintf-posix.h: New file, extracted from
tests/test-dprintf-posix.c.
* tests/test-dprintf-posix.c: Include it. Don't include infinity.h.
(test_function): Remove function.
* modules/dprintf-posix-tests (Files): Add it.
* tests/test-dzprintf-posix.c: New file, based on
tests/test-dprintf-posix.c.
* tests/test-dzprintf-posix.sh: New file, based on
tests/test-dprintf-posix.sh.
* modules/dzprintf-posix-tests: New file.
Bruno Haible [Sun, 30 Jun 2024 15:21:04 +0000 (17:21 +0200)]
vdzprintf-posix: Add tests.
* tests/test-fprintf-posix.h (test_function): Use RETTYPE instead of
'int'.
* tests/test-fprintf-posix.c (RETTYPE): New macro.
* tests/test-vdprintf-posix.c (RETTYPE): New macro.
* tests/test-vfprintf-posix.c (RETTYPE): New macro.
* tests/test-xfprintf-posix.c (RETTYPE): New macro.
* tests/test-vdzprintf-posix.c: New file, based on
tests/test-vdprintf-posix.c.
* tests/test-vdzprintf-posix.sh: New file, based on
tests/test-vdprintf-posix.sh.
* modules/vdzprintf-posix-tests: New file.
Paul Eggert [Sun, 30 Jun 2024 10:27:48 +0000 (11:27 +0100)]
strnlen: avoid undefined memcmp behavior
Problem reported by Po Lu in:
https://lists.gnu.org/r/bug-gnulib/2024-06/msg00288.html
* config/srclist.txt: Don’t mention strnlen.c even in a comment,
as the Gnulib and glibc implementations have diverged for
portability reasons, and they’re never likely to merge.
* lib/strnlen.c (strnlen): Avoid undefined behavior if
the array S points to has fewer than MAXLEN bytes.
Jim Meyering [Sat, 29 Jun 2024 22:08:19 +0000 (15:08 -0700)]
bootstrap-funclib.sh: shrink or split too-long lines
* top/bootstrap-funclib.sh: The generated bootstrap file had lines
lines that triggered a syntax-check failure. Sure, I could have
exempted this file, but it was easy to comply. Besides, this also
fixed a quoting bug in the event that ${GNULIB_URL:-$default_gnulib_url}
had a value requiring double quotes.
* build-aux/bootstrap: Regenerate.
Bruno Haible [Sat, 29 Jun 2024 11:28:14 +0000 (13:28 +0200)]
tests: Avoid test failures due to VirtualBox specific bug.
* tests/virtualbox.h: New file.
* tests/test-pthread-cond.c: Include virtualbox.h.
(main): Skip the test under VirtualBox with KVM paravirtualization and
more than 1 CPU.
* tests/test-cnd.c: Include virtualbox.h.
(main): Skip the test under VirtualBox with KVM paravirtualization and
more than 1 CPU.
* tests/test-cond.c: Include virtualbox.h.
(main): Skip the test under VirtualBox with KVM paravirtualization and
more than 1 CPU.
* tests/test-pthread_sigmask1.c: Include virtualbox.h.
(main): Skip the test under VirtualBox with KVM paravirtualization and
more than 1 CPU.
* tests/test-pthread_sigmask2.c: Include virtualbox.h.
(main): Skip the test under VirtualBox with KVM paravirtualization and
more than 1 CPU.
* tests/test-sigprocmask.c: Include virtualbox.h.
(main): Skip the test under VirtualBox with KVM paravirtualization and
more than 1 CPU.
* modules/pthread-cond-tests (Files): Add tests/virtualbox.h.
* modules/cnd-tests (Files): Likewise.
* modules/cond-tests (Files): Likewise.
* modules/pthread_sigmask-tests (Files): Likewise.
* modules/sigprocmask-tests (Files): Likewise.
Bruno Haible [Fri, 28 Jun 2024 20:15:23 +0000 (22:15 +0200)]
cond tests: Avoid theoretically possible failure.
* tests/test-cnd.c (cnd_wait_routine, cnd_timedwait_routine): Report to
the main thread if this thread comes too late.
(test_cnd_wait, test_cnd_timedwait): Return a 'skipped' value.
(main): Print SKIP instead of OK if the essence of the test was skipped.
* tests/test-cond.c (cond_routine, timedcond_routine): Report to the
main thread if this thread comes too late.
(test_cond, test_timedcond): Return a 'skipped' value.
(main): Print SKIP instead of OK if the essence of the test was skipped.
* tests/test-pthread-cond.c (pthread_cond_wait_routine,
pthread_cond_timedwait_routine): Report to the main thread if this
thread comes too late.
(test_pthread_cond_wait, test_pthread_cond_timedwait): Return a
'skipped' value.
(main): Print SKIP instead of OK if the essence of the test was skipped.
Paul Eggert [Wed, 26 Jun 2024 16:16:06 +0000 (17:16 +0100)]
strnlen: document Android bug
* doc/posix-functions/strnlen.texi (strnlen):
Mention Android 5.0 bug reported by Po Lu in this thread:
https://lists.gnu.org/r/bug-gnulib/2024-06/msg00271.html
Collin Funk [Wed, 26 Jun 2024 04:39:50 +0000 (21:39 -0700)]
idpriv-droptemp: Handle large user and group ids.
* lib/idpriv-droptemp.c (saved_uid): Use uid_t instead of int.
(saved_gid): Use gid_t instead of int.
(idpriv_temp_drop): Use uid_t and gid_t instead of int.
(idpriv_temp_restore): Likewise.
Bruno Haible [Tue, 25 Jun 2024 23:05:05 +0000 (01:05 +0200)]
c-vazsprintf-gnu: Add tests.
* tests/test-vazsprintf-gnu.h: New file, extracted from
tests/test-vazsprintf-gnu.c.
* tests/test-vazsprintf-gnu.c: Include test-vazsprintf-gnu.h.
(test_function): Moved out to tests/test-vazsprintf-gnu.h.
* modules/vazsprintf-gnu-tests (Files): Add tests/test-vazsprintf-gnu.h.
* tests/test-c-vazsprintf-gnu.c: New file.
* tests/test-c-vazsprintf-gnu.sh: New file, based on
tests/test-c-snprintf.sh.
* modules/c-vazsprintf-gnu-tests: New file.
Bruno Haible [Tue, 25 Jun 2024 23:04:43 +0000 (01:04 +0200)]
c-zsnprintf-gnu: Add tests.
* tests/test-c-zsnprintf-gnu.c: New file.
* tests/test-c-zsnprintf-gnu.sh: New file, based on
tests/test-c-snprintf.sh.
* modules/c-zsnprintf-gnu-tests: New file.
Bruno Haible [Tue, 25 Jun 2024 23:04:02 +0000 (01:04 +0200)]
c-vzsnprintf-gnu: Add tests.
* tests/test-c-vzsnprintf-gnu.c: New file, based on
tests/test-vzsnprintf-gnu.c.
* tests/test-c-vzsnprintf-gnu.sh: New file, based on
tests/test-c-snprintf.sh.
* modules/c-vzsnprintf-gnu-tests: New file.
Bruno Haible [Tue, 25 Jun 2024 17:27:42 +0000 (19:27 +0200)]
c-vasnprintf: Add tests.
* tests/test-c-vasnprintf.c: New file, based on tests/test-c-snprintf.c.
* tests/test-c-vasnprintf.sh: New file, based on
tests/test-c-snprintf.sh.
* modules/c-vasnprintf-tests: New file.
Bruno Haible [Tue, 25 Jun 2024 14:40:28 +0000 (16:40 +0200)]
vzsprintf-gnu: Add tests.
* tests/test-vzsprintf-gnu.c: New file.
* tests/test-zsprintf-gnu.h: New file, based on
tests/test-zsnprintf-gnu.h.
* modules/vzsprintf-gnu-tests: New file.
Bruno Haible [Tue, 25 Jun 2024 14:38:11 +0000 (16:38 +0200)]
vzsnprintf-gnu: Add tests.
* tests/test-vzsnprintf-gnu.c: New file.
* tests/test-zsnprintf-gnu.h: New file, based on
tests/test-snprintf-gnu.h.
* modules/vzsnprintf-gnu-tests: New file.
Bruno Haible [Mon, 24 Jun 2024 23:09:49 +0000 (01:09 +0200)]
vzsprintf-posix: Add tests.
* tests/test-vzsprintf-posix.c: New file.
* tests/test-zsprintf-posix.h: New file, based on
tests/test-zsnprintf-posix.h.
* modules/vzsprintf-posix-tests: New file.
Bruno Haible [Mon, 24 Jun 2024 23:09:28 +0000 (01:09 +0200)]
vzsnprintf-posix: Add tests.
* tests/test-vzsnprintf-posix.c: New file.
* tests/test-zsnprintf-posix.h: New file, based on
tests/test-snprintf-posix.h.
* modules/vzsnprintf-posix-tests: New file.
Bruno Haible [Mon, 24 Jun 2024 18:11:48 +0000 (20:11 +0200)]
c-vasnprintf: Relicense under LGPLv2+.
* lib/c-vasnprintf.h: Rebase on lib/vasnprintf.h.
* lib/c-vasnprintf.c: Rebase on lib/unistdio/ulc-vasnprintf.c.
* modules/c-vasnprintf (License): Change to LGPLv2+.