]> Savannah Git Hosting - gnulib.git/log
gnulib.git
10 months agoc-zsnprintf-gnu: New module.
Bruno Haible [Tue, 25 Jun 2024 23:04:26 +0000 (01:04 +0200)]
c-zsnprintf-gnu: New module.

* modules/c-zsnprintf-gnu: New file.

10 months agoc-vzsnprintf-gnu: Add tests.
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.

10 months agoc-vzsnprintf-gnu: New module.
Bruno Haible [Tue, 25 Jun 2024 23:03:35 +0000 (01:03 +0200)]
c-vzsnprintf-gnu: New module.

* modules/c-vzsnprintf-gnu: New file.

10 months agoc-vasnprintf: Add tests.
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.

10 months agoc-vasnprintf: Fix link errors.
Bruno Haible [Tue, 25 Jun 2024 17:35:20 +0000 (19:35 +0200)]
c-vasnprintf: Fix link errors.

* modules/c-vasnprintf (configure.ac): Ensure printf-args.c and
printf-parse.c get compiled. Invoke gl_PREREQ_PRINTF_ARGS,
gl_PREREQ_PRINTF_PARSE.

10 months agoobstack-zprintf-gnu: Add tests.
Bruno Haible [Tue, 25 Jun 2024 14:43:20 +0000 (16:43 +0200)]
obstack-zprintf-gnu: Add tests.

* tests/test-obstack-zprintf-gnu.c: New file, based on
tests/test-vazsprintf-gnu.c.
* modules/obstack-zprintf-gnu-tests: New file.

10 months agoobstack-zprintf-gnu: New module.
Bruno Haible [Tue, 25 Jun 2024 14:42:56 +0000 (16:42 +0200)]
obstack-zprintf-gnu: New module.

* modules/obstack-zprintf-gnu: New file.

10 months agovazsprintf-gnu: Add tests.
Bruno Haible [Tue, 25 Jun 2024 14:42:30 +0000 (16:42 +0200)]
vazsprintf-gnu: Add tests.

* tests/test-vazsprintf-gnu.c: New file, based on
tests/test-zsnprintf-gnu.h.
* modules/vazsprintf-gnu-tests: New file.

10 months agovazsprintf-gnu: New module.
Bruno Haible [Tue, 25 Jun 2024 14:42:04 +0000 (16:42 +0200)]
vazsprintf-gnu: New module.

* modules/vazsprintf-gnu: New file.

10 months agozsprintf-gnu: Add tests.
Bruno Haible [Tue, 25 Jun 2024 14:41:31 +0000 (16:41 +0200)]
zsprintf-gnu: Add tests.

* tests/test-zsprintf-gnu.c: New file.
* modules/zsprintf-gnu-tests: New file.

10 months agozsprintf-gnu: New module.
Bruno Haible [Tue, 25 Jun 2024 14:41:03 +0000 (16:41 +0200)]
zsprintf-gnu: New module.

* modules/zsprintf-gnu: New file.

10 months agovzsprintf-gnu: Add tests.
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.

10 months agovzsprintf-gnu: New module.
Bruno Haible [Tue, 25 Jun 2024 14:39:59 +0000 (16:39 +0200)]
vzsprintf-gnu: New module.

* modules/vzsprintf-gnu: New file.

10 months agozsnprintf-gnu: Add tests.
Bruno Haible [Tue, 25 Jun 2024 14:39:20 +0000 (16:39 +0200)]
zsnprintf-gnu: Add tests.

* tests/test-zsnprintf-gnu.c: New file.
* modules/zsnprintf-gnu-tests: New file.

10 months agozsnprintf-gnu: New module.
Bruno Haible [Tue, 25 Jun 2024 14:38:52 +0000 (16:38 +0200)]
zsnprintf-gnu: New module.

* modules/zsnprintf-gnu: New file.

10 months agovzsnprintf-gnu: Add tests.
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.

10 months agovzsnprintf-gnu: New module.
Bruno Haible [Tue, 25 Jun 2024 14:36:18 +0000 (16:36 +0200)]
vzsnprintf-gnu: New module.

* modules/vzsnprintf-gnu: New file.

10 months agoobstack-zprintf-posix: Add tests.
Bruno Haible [Mon, 24 Jun 2024 23:10:34 +0000 (01:10 +0200)]
obstack-zprintf-posix: Add tests.

* tests/test-obstack-zprintf-posix.c: New file, based on
tests/test-vazsprintf-posix.c.
* modules/obstack-zprintf-posix-tests: New file.

10 months agoobstack-zprintf-posix: New module.
Bruno Haible [Mon, 24 Jun 2024 23:10:30 +0000 (01:10 +0200)]
obstack-zprintf-posix: New module.

* modules/obstack-zprintf-posix: New file.

10 months agovazsprintf-posix: Add tests.
Bruno Haible [Mon, 24 Jun 2024 23:10:08 +0000 (01:10 +0200)]
vazsprintf-posix: Add tests.

* tests/test-vazsprintf-posix.c: New file, based on
tests/test-zsnprintf-posix.h.
* modules/vazsprintf-posix-tests: New file.

10 months agovazsprintf-posix: New module.
Bruno Haible [Mon, 24 Jun 2024 23:10:03 +0000 (01:10 +0200)]
vazsprintf-posix: New module.

* modules/vazsprintf-posix: New file.

10 months agozsprintf-posix: Add tests.
Bruno Haible [Mon, 24 Jun 2024 23:09:59 +0000 (01:09 +0200)]
zsprintf-posix: Add tests.

* tests/test-zsprintf-posix.c: New file.
* modules/zsprintf-posix-tests: New file.

10 months agozsprintf-posix: New module.
Bruno Haible [Mon, 24 Jun 2024 23:09:55 +0000 (01:09 +0200)]
zsprintf-posix: New module.

* modules/zsprintf-posix: New file.

10 months agovzsprintf-posix: Add tests.
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.

10 months agovzsprintf-posix: New module.
Bruno Haible [Mon, 24 Jun 2024 23:09:45 +0000 (01:09 +0200)]
vzsprintf-posix: New module.

* modules/vzsprintf-posix: New file.

10 months agozsnprintf-posix: Add tests.
Bruno Haible [Mon, 24 Jun 2024 23:09:40 +0000 (01:09 +0200)]
zsnprintf-posix: Add tests.

* tests/test-zsnprintf-posix.c: New file.
* modules/zsnprintf-posix-tests: New file.

10 months agozsnprintf-posix: New module.
Bruno Haible [Mon, 24 Jun 2024 23:09:34 +0000 (01:09 +0200)]
zsnprintf-posix: New module.

* modules/zsnprintf-posix: New file.

10 months agovzsnprintf-posix: Add tests.
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.

10 months agovzsnprintf-posix: New module.
Bruno Haible [Mon, 24 Jun 2024 23:09:21 +0000 (01:09 +0200)]
vzsnprintf-posix: New module.

* modules/vzsnprintf-posix: New file.

10 months agoEase maintainability of *printf-gnu modules.
Bruno Haible [Mon, 24 Jun 2024 23:04:22 +0000 (01:04 +0200)]
Ease maintainability of *printf-gnu modules.

* modules/mixin/printf-gnu: New file.
* modules/dprintf-gnu (Depends-on): Add it.
* modules/fprintf-gnu (Depends-on): Likewise.
* modules/obstack-printf-gnu (Depends-on): Likewise.
* modules/printf-gnu (Depends-on): Likewise.
* modules/snprintf-gnu (Depends-on): Likewise.
* modules/sprintf-gnu (Depends-on): Likewise.
* modules/vasnprintf-gnu (Depends-on): Likewise.
* modules/vasnwprintf-gnu (Depends-on): Likewise.
* modules/vasprintf-gnu (Depends-on): Likewise.
* modules/vdprintf-gnu (Depends-on): Likewise.
* modules/vfprintf-gnu (Depends-on): Likewise.
* modules/vprintf-gnu (Depends-on): Likewise.
* modules/vsnprintf-gnu (Depends-on): Likewise.
* modules/vsprintf-gnu (Depends-on): Likewise.

10 months agoReduce duplication among *printf-posix modules.
Bruno Haible [Mon, 24 Jun 2024 23:04:11 +0000 (01:04 +0200)]
Reduce duplication among *printf-posix modules.

* modules/mixin/printf-posix: New file.
* modules/c-vasnprintf (Depends-on): Add it. Remove isnan*-nolibm,
frexp*-nolibm, printf-frexp*, signbit, fpucw.
* modules/dprintf-posix (Depends-on): Likewise.
* modules/fprintf-posix (Depends-on): Likewise.
* modules/snprintf-posix (Depends-on): Likewise.
* modules/sprintf-posix (Depends-on): Likewise.
* modules/unistdio/u16-u16-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u16-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u32-u32-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u32-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u8-u8-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u8-vasnprintf (Depends-on): Likewise.
* modules/unistdio/ulc-vasnprintf (Depends-on): Likewise.
* modules/vasnprintf-posix (Depends-on): Likewise.
* modules/vasnwprintf-posix (Depends-on): Likewise.
* modules/vasprintf-posix (Depends-on): Likewise.
* modules/vdprintf-posix (Depends-on): Likewise.
* modules/vfprintf-posix (Depends-on): Likewise.
* modules/vsnprintf-posix (Depends-on): Likewise.
* modules/vsprintf-posix (Depends-on): Likewise.

10 months agoc-vasnprintf: Relicense under LGPLv2+.
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+.

10 months agodoc: Update info about *printf.
Bruno Haible [Mon, 24 Jun 2024 18:05:28 +0000 (20:05 +0200)]
doc: Update info about *printf.

* doc/*-functions/*printf.texi: Update info regarding size specifiers
w8, wf8, etc.

10 months agodoc: Update info about *printf.
Bruno Haible [Mon, 24 Jun 2024 18:04:54 +0000 (20:04 +0200)]
doc: Update info about *printf.

* doc/*-functions/*printf.texi: Update info regarding %B directive.

10 months agodoc: Update info about *printf.
Bruno Haible [Mon, 24 Jun 2024 18:04:20 +0000 (20:04 +0200)]
doc: Update info about *printf.

* doc/*-functions/*printf.texi: Update info regarding %b directive.

10 months agodoc: Update info about *printf.
Bruno Haible [Mon, 24 Jun 2024 18:03:39 +0000 (20:03 +0200)]
doc: Update info about *printf.

* doc/*-functions/*printf.texi: Update info regarding %f, %e, %g
directives.

10 months agodoc: Update info about *printf.
Bruno Haible [Mon, 24 Jun 2024 18:02:46 +0000 (20:02 +0200)]
doc: Update info about *printf.

* doc/*-functions/*printf.texi: Update info regarding %a directive.
* m4/printf.m4 (gl_PRINTF_DIRECTIVE_A): Likewise. Improve bits
assignment in return value.

10 months agodoc: Update info about obstack_*printf.
Bruno Haible [Mon, 24 Jun 2024 18:02:04 +0000 (20:02 +0200)]
doc: Update info about obstack_*printf.

* doc/glibc-functions/obstack_*printf.texi: Update info.

10 months agogit-merge-changelog: Improve last commit.
Bruno Haible [Mon, 24 Jun 2024 11:11:31 +0000 (13:11 +0200)]
git-merge-changelog: Improve last commit.

* lib/git-merge-changelog.c (conflict_write): Add comments.

10 months agogit-merge-changelog: Improve conflict markers.
Andreas Schwab [Mon, 24 Jun 2024 10:38:39 +0000 (12:38 +0200)]
git-merge-changelog: Improve conflict markers.

* lib/git-merge-changelog.c (conflict_write): Add a space after <<<<<<<
and >>>>>>>.

Copyright-paperwork-exempt: Yes

10 months agotest-framework-sh: Fix typo in function invocation (regression 2024-06-11).
Collin Funk [Mon, 24 Jun 2024 01:28:26 +0000 (18:28 -0700)]
test-framework-sh: Fix typo in function invocation (regression 2024-06-11).

* tests/init.sh (mktempd_): Invoke fail_ properly.

10 months agoobstack-zprintf: Add more tests.
Bruno Haible [Sat, 22 Jun 2024 20:02:53 +0000 (22:02 +0200)]
obstack-zprintf: Add more tests.

* tests/test-obstack-zprintf-big.c: New file, based on
tests/test-vasnprintf-big.c.
* modules/obstack-zprintf-extra-tests: New file.
* modules/obstack-zprintf-tests (Depends-on): Add it.

10 months agoobstack-zprintf: Add tests.
Bruno Haible [Sat, 22 Jun 2024 19:59:50 +0000 (21:59 +0200)]
obstack-zprintf: Add tests.

* tests/test-obstack-printf.h: New file, based on
tests/test-obstack-printf.c.
* tests/test-obstack-printf.c: Include test-obstack-printf.h.
(obstack_chunk_alloc, obstack_chunk_free, test_function): Moved to
tests/test-obstack-printf.h.
(test_obstack_vprintf, test_obstack_printf): Remove functions.
(main): Inline them here.
* tests/test-obstack-zprintf.c: New file, based on
tests/test-obstack-printf.c.
* modules/obstack-printf-tests (Files): Add tests/test-obstack-printf.h.
* modules/obstack-zprintf-tests: New file.

10 months agoobstack-zprintf: New module.
Bruno Haible [Sat, 22 Jun 2024 19:31:46 +0000 (21:31 +0200)]
obstack-zprintf: New module.

* lib/stdio.in.h (obstack_zprintf, obstack_vzprintf): New declarations.
(obstack_printf, obstack_vprintf): Tweak comment.
* lib/obstack_printf.c: Parameterize.
(RESULT_TYPE, OBSTACK_PRINTF, OBSTACK_VPRINTF): New macros.
* lib/obstack_zprintf.c: New file.
* m4/stdio_h.m4 (gl_STDIO_H_REQUIRE_DEFAULTS): Initialize
GNULIB_OBSTACK_ZPRINTF.
* modules/stdio (Makefile.am): Substitute GNULIB_OBSTACK_ZPRINTF.
* modules/obstack-zprintf: New file.

10 months agophysmem: Fix typo.
Bruno Haible [Sat, 22 Jun 2024 11:05:11 +0000 (13:05 +0200)]
physmem: Fix typo.

* lib/physmem.h (physmem_claimable): Fix typo in comment.

10 months agoc-xvasprintf: Guarantee a non-NULL result.
Bruno Haible [Sat, 22 Jun 2024 10:22:12 +0000 (12:22 +0200)]
c-xvasprintf: Guarantee a non-NULL result.

* lib/c-xvasprintf.h: Clarify the programmer's responsibilities.
(c_xasprintf, c_xvasprintf): Declare as returning non-NULL.
* lib/c-xvasprintf.c: Include <stdlib.h>, <string.h>.
(c_xvasprintf): Call c_vazsprintf instead of c_vasprintf. When some
other error occurs, emit an error message and abort.
* modules/c-xvasprintf (Files): Add m4/strerrorname_np.m4.
(Depends-on): Add extensions, c-vazsprintf. Remove c-vasprintf.
(configure.ac): Invoke gl_OPTIONAL_STRERRORNAME_NP.
* NEWS: Mention the change.

10 months agoc-vasprintf: Make return convention consistent with other modules.
Bruno Haible [Sat, 22 Jun 2024 10:21:51 +0000 (12:21 +0200)]
c-vasprintf: Make return convention consistent with other modules.

* lib/c-vasprintf.h (c_asprintf, c_vasprintf): Add specification.
* lib/c-asprintf.c: Replaced with code based on lib/asprintf.c.
* lib/c-vasprintf.c: Replaced with code based on lib/vasprintf.c.
* modules/c-vasprintf (Depends-on): Add stdint.
(License): Change to LGPLv2+.

10 months agoc-vazsprintf: New module.
Bruno Haible [Sat, 22 Jun 2024 10:21:46 +0000 (12:21 +0200)]
c-vazsprintf: New module.

* lib/c-vasprintf.h: Change license to LGPLv2+.
Include <stddef.h>.
(c_azsprintf, c_vazsprintf): New declarations.
* lib/c-azsprintf.c: New file, based on lib/azsprintf.c.
* lib/c-vazsprintf.c: New file, based on lib/vazsprintf.c.
* modules/c-vazsprintf: New file.

10 months agoc-snprintf: Use c-vzsnprintf.
Bruno Haible [Sat, 22 Jun 2024 10:21:35 +0000 (12:21 +0200)]
c-snprintf: Use c-vzsnprintf.

* lib/c-snprintf.h (c_snprintf): Move specification to here.
* lib/c-snprintf.c: Change license to LGPLv2+.
Don't include <stdlib.h>, <string.h>, c-vasnprintf.h. Include
<stdint.h>, c-vsnprintf.h.
(c_snprintf): Implement based on c_vzsnprintf.
* modules/c-snprintf (Depends-on): Add stdint, c-vzsnprintf. Remove
c-vasnprintf.

10 months agoc-zsnprintf: New module.
Bruno Haible [Sat, 22 Jun 2024 10:21:29 +0000 (12:21 +0200)]
c-zsnprintf: New module.

* lib/c-snprintf.h: Change license to LGPLv2+.
(c_zsnprintf): New declaration.
* lib/c-zsnprintf.c: New file, based on lib/zsnprintf.c.
* modules/c-zsnprintf: New file.

10 months agoc-vsnprintf: Use c-vzsnprintf.
Bruno Haible [Sat, 22 Jun 2024 10:21:20 +0000 (12:21 +0200)]
c-vsnprintf: Use c-vzsnprintf.

* lib/c-vsnprintf.h (c_vsnprintf): Move specification to here.
* lib/c-vsnprintf.c: Change license to LGPLv2+.
Don't include <stdlib.h>, <string.h>, c-vasnprintf.h. Include
<stdint.h>.
(c_vsnprintf): Implement based on c_vzsnprintf.
* modules/c-vsnprintf (Depends-on): Add stdint, c-vzsnprintf. Remove
c-vasnprintf.
(License): Change to LGPLv2+.

10 months agoc-vzsnprintf: New module.
Bruno Haible [Sat, 22 Jun 2024 10:21:11 +0000 (12:21 +0200)]
c-vzsnprintf: New module.

* lib/c-vsnprintf.h: Change license to LGPLv2+.
(c_vzsnprintf): New declaration.
* lib/c-vzsnprintf.c: New file, based on lib/vzsnprintf.c.
* modules/c-vzsnprintf: New file.

10 months agoxvasprintf: Guarantee a non-NULL result.
Bruno Haible [Sat, 22 Jun 2024 10:17:51 +0000 (12:17 +0200)]
xvasprintf: Guarantee a non-NULL result.

* lib/xvasprintf.h: Clarify the programmer's responsibilities.
(xasprintf, xvasprintf): Declare as returning non-NULL.
* lib/xvasprintf.c: Include <stdlib.h>.
(xstrcat): Allow results longer than INT_MAX characters. Upon size
overflow, invoke xalloc_die.
(xvasprintf): Call vazsprintf instead of vasprintf. When some other
error occurs, emit an error message and abort.
* m4/strerrorname_np.m4 (gl_CHECK_STRERRORNAME_NP): New macro, extracted
from gl_FUNC_STRERRORNAME_NP.
(gl_FUNC_STRERRORNAME_NP): Invoke it.
(gl_OPTIONAL_STRERRORNAME_NP): New macro.
* m4/xvasprintf.m4 (gl_XVASPRINTF): Invoke gl_OPTIONAL_STRERRORNAME_NP.
* modules/xvasprintf (Files): Add m4/strerrorname_np.m4.
(Depends-on): Add extensions, vazsprintf. Remove vasprintf.
* NEWS: Mention the change.

10 months agovasprintf: Make return convention consistent with other modules.
Bruno Haible [Sat, 22 Jun 2024 10:17:10 +0000 (12:17 +0200)]
vasprintf: Make return convention consistent with other modules.

* lib/vasprintf.c: Include <stdint.h>.
(vasprintf): If the length is > PTRDIFF_MAX, fail with ENOMEM, not
EOVERFLOW.
* modules/vasprintf (Depends-on): Add stdint.

10 months agovazsprintf: New module.
Bruno Haible [Sat, 22 Jun 2024 10:17:02 +0000 (12:17 +0200)]
vazsprintf: New module.

* lib/stdio.in.h (azsprintf, vazsprintf): New declarations.
* lib/vazsprintf.c: New file, based on lib/vasprintf.c.
* lib/azsprintf.c: New file, based on lib/asprintf.c.
* m4/stdio_h.m4 (gl_STDIO_H_REQUIRE_DEFAULTS): Initialize
GNULIB_VAZSPRINTF.
* modules/stdio (Makefile.am): Substitute GNULIB_VAZSPRINTF.
* modules/vazsprintf: New file.

10 months agosprintf-posix: Use vzsprintf.
Bruno Haible [Sat, 22 Jun 2024 10:16:30 +0000 (12:16 +0200)]
sprintf-posix: Use vzsprintf.

* lib/stdio.in.h (sprintf): Move specification to here.
* lib/sprintf.c: Don't include <stdlib.h>, vasnprintf.h. Include
<stdint.h>.
(sprintf): Implement based on vzsprintf.
* modules/sprintf-posix (Depends-on): Add vzsprintf. Remove vasnprintf.

10 months agozsprintf: New module.
Bruno Haible [Sat, 22 Jun 2024 10:16:24 +0000 (12:16 +0200)]
zsprintf: New module.

* lib/stdio.in.h (zsprintf): New declaration, based on
lib/sprintf.c.
* lib/zsprintf.c: New file, based on lib/sprintf.c.
* m4/stdio_h.m4 (gl_STDIO_H_REQUIRE_DEFAULTS): Initialize
GNULIB_ZSPRINTF.
* modules/stdio (Makefile.am): Substitute GNULIB_ZSPRINTF.
* modules/zsprintf: New file.

10 months agovsprintf-posix: Use vzsprintf.
Bruno Haible [Sat, 22 Jun 2024 10:16:06 +0000 (12:16 +0200)]
vsprintf-posix: Use vzsprintf.

* lib/stdio.in.h (vsprintf): Move specification to here.
* lib/vsprintf.c: Don't include <stdlib.h>, vasnprintf.h.
(SIZE_MAX): Remove macro.
(vsprintf): Implement based on vzsprintf.
* modules/vsprintf-posix (Depends-on): Add vzsprintf. Remove vasnprintf.

10 months agovzsprintf: New module.
Bruno Haible [Sat, 22 Jun 2024 10:16:00 +0000 (12:16 +0200)]
vzsprintf: New module.

* lib/stdio.in.h (vzsprintf): New declaration, based on
lib/vsprintf.c.
* lib/vzsprintf.c: New file, based on lib/vsprintf.c.
* m4/stdio_h.m4 (gl_STDIO_H_REQUIRE_DEFAULTS): Initialize
GNULIB_VZSPRINTF.
* modules/stdio (Makefile.am): Substitute GNULIB_VZSPRINTF.
* modules/vzsprintf: New file.

10 months agosnprintf: Use vzsnprintf.
Bruno Haible [Sat, 22 Jun 2024 10:15:38 +0000 (12:15 +0200)]
snprintf: Use vzsnprintf.

* lib/stdio.in.h (snprintf): Move specification to here.
* lib/snprintf.c: Don't include <stdlib.h>, <string.h>, vasnprintf.h.
Include <stdint.h>.
(snprintf): Implement based on vzsnprintf.
* modules/snprintf (Depends-on): Add stdint, vzsnprintf. Remove
vasnprintf.

10 months agozsnprintf: New module.
Bruno Haible [Sat, 22 Jun 2024 10:15:32 +0000 (12:15 +0200)]
zsnprintf: New module.

* lib/stdio.in.h (zsnprintf): New declaration, based on
lib/snprintf.c.
* lib/zsnprintf.c: New file, based on lib/snprintf.c.
* m4/stdio_h.m4 (gl_STDIO_H_REQUIRE_DEFAULTS): Initialize
GNULIB_ZSNPRINTF.
* modules/stdio (Makefile.am): Substitute GNULIB_ZSNPRINTF.
* modules/zsnprintf: New file.

10 months agovsnprintf: Use vzsnprintf.
Bruno Haible [Sat, 22 Jun 2024 10:14:52 +0000 (12:14 +0200)]
vsnprintf: Use vzsnprintf.

* lib/stdio.in.h (vsnprintf): Move specification to here.
* lib/vsnprintf.c: Don't include <stdlib.h>, <string.h>, vasnprintf.h.
Include <stdint.h>.
(vsnprintf): Implement based on vzsnprintf.
* modules/vsnprintf (Depends-on): Add stdint, vzsnprintf. Remove
vasnprintf.

10 months agovzsnprintf: New module.
Bruno Haible [Sat, 22 Jun 2024 10:14:41 +0000 (12:14 +0200)]
vzsnprintf: New module.

* lib/stdio.in.h (vzsnprintf): New declaration, based on
lib/vsnprintf.c.
* lib/vzsnprintf.c: New file, based on lib/vsnprintf.c.
* m4/stdio_h.m4 (gl_STDIO_H_REQUIRE_DEFAULTS): Initialize
GNULIB_VZSNPRINTF.
* modules/stdio (Makefile.am): Substitute GNULIB_VZSNPRINTF.
* modules/vzsnprintf: New file.

10 months agotest-framework-sh: Fix side effect on dfa tests (regression 2024-06-11).
Bruno Haible [Thu, 20 Jun 2024 19:56:15 +0000 (21:56 +0200)]
test-framework-sh: Fix side effect on dfa tests (regression 2024-06-11).

* tests/init.sh (returns_): Silence the 'local is_tracing' assignment
for real.

10 months agotest-framework-sh: Fix side effect on dfa tests (regression 2024-06-11).
Bruno Haible [Thu, 20 Jun 2024 14:36:28 +0000 (16:36 +0200)]
test-framework-sh: Fix side effect on dfa tests (regression 2024-06-11).

* tests/init.sh (returns_): Silence the 'local is_tracing' assignment.

10 months agoautoupdate
Karl Berry [Thu, 20 Jun 2024 14:22:00 +0000 (07:22 -0700)]
autoupdate

10 months agovasnwprintf tests: Add test of huge %ls arguments.
Bruno Haible [Thu, 20 Jun 2024 06:13:25 +0000 (08:13 +0200)]
vasnwprintf tests: Add test of huge %ls arguments.

* tests/test-vasnwprintf-big.c (main): Add tests for wide string
arguments with > 2^31 wide characters.

10 months agovasnwprintf: Support huge wide string arguments.
Bruno Haible [Thu, 20 Jun 2024 06:11:53 +0000 (08:11 +0200)]
vasnwprintf: Support huge wide string arguments.

* lib/vasnprintf.c: (VASNPRINTF): In 64-bit builds, handle the %ls
directive ourselves.
(local_wcslen): Adjust #if condition.

10 months agoFix last ChangeLog entry.
Bruno Haible [Thu, 20 Jun 2024 06:03:58 +0000 (08:03 +0200)]
Fix last ChangeLog entry.

10 months agosigsegv: avoid unlikely undefined behavior
Paul Eggert [Thu, 20 Jun 2024 04:19:42 +0000 (00:19 -0400)]
sigsegv: avoid unlikely undefined behavior

Problem found by Coverity for diffutils and reported by Wasser Mai in:
https://bugs.gnu.org/71535
* lib/stackvma.c (rof_open) [__linux__ || __FreeBSD__ || etc]:
Don’t assume result of ‘read’ fits in int.
Avoid undefined behavior if ‘n + MIN_LEFTOVER’ would overflow.
Also, move a test to be after an (n == 0) test, to help the compiler.

10 months agovasnprintf, u*-asnprintf tests: Add test of huge %ls arguments.
Bruno Haible [Thu, 20 Jun 2024 01:24:18 +0000 (03:24 +0200)]
vasnprintf, u*-asnprintf tests: Add test of huge %ls arguments.

* tests/test-vasnprintf-big.c: Include <wchar.h>.
(main): Add tests for wide string arguments with > 2^31 wide characters.
* tests/unistdio/test-u8-asnprintf-big.c: Include <wchar.h>.
(main): Add tests for wide string arguments with > 2^31 wide characters.
* tests/unistdio/test-ulc-asnprintf-big.c: Include <wchar.h>.
(main): Add tests for wide string arguments with > 2^31 wide characters.

10 months agovasnprintf, u*-vasnprintf: Support huge wide string arguments.
Bruno Haible [Thu, 20 Jun 2024 01:19:15 +0000 (03:19 +0200)]
vasnprintf, u*-vasnprintf: Support huge wide string arguments.

* lib/vasnprintf.c: (VASNPRINTF): In 64-bit builds, handle the %ls
directive ourselves.
(local_wcslen, local_wcrtomb): Adjust #if condition.

10 months agovasnwprintf tests: Add test of %s directive with large arguments.
Bruno Haible [Wed, 19 Jun 2024 23:31:21 +0000 (01:31 +0200)]
vasnwprintf tests: Add test of %s directive with large arguments.

* tests/test-vasnwprintf-big.c: New file, based on
tests/test-vasnprintf-big.c.
* modules/vasnwprintf-extra-tests: New file.
* modules/vasnwprintf-tests (Depends-on): Depend on it.

10 months agovasnprintf, u*-asnprintf tests: Adjust memory need.
Bruno Haible [Wed, 19 Jun 2024 23:28:33 +0000 (01:28 +0200)]
vasnprintf, u*-asnprintf tests: Adjust memory need.

* tests/test-vasnprintf-big.c (main): Require 10, not 12, GiB of RAM.
* tests/unistdio/test-u8-asnprintf-big.c (main): Require 15 GiB of RAM.
* tests/unistdio/test-ulc-asnprintf-big.c (main): Likewise.

10 months agou8-asnprintf tests: Fix mistake.
Bruno Haible [Wed, 19 Jun 2024 23:27:12 +0000 (01:27 +0200)]
u8-asnprintf tests: Fix mistake.

* tests/unistdio/test-u8-asnprintf-big.c: Include <unistr.h>.
(main): Use u8_strlen instead of strlen.
* modules/unistdio/u8-asnprintf-extra-tests (Depends-on): Add
unistr/u8-strlen.

10 months agofilemode tests: Fix comment.
Collin Funk [Wed, 19 Jun 2024 21:52:49 +0000 (14:52 -0700)]
filemode tests: Fix comment.

* tests/test-filemode.c: Make the file description accurate.

10 months agoulc-asnprintf tests: Add test of %U, %s directives with large arguments.
Bruno Haible [Wed, 19 Jun 2024 18:58:18 +0000 (20:58 +0200)]
ulc-asnprintf tests: Add test of %U, %s directives with large arguments.

* tests/unistdio/test-ulc-asnprintf-big.c: New file, based on
tests/test-vasnprintf-big.c.
* modules/unistdio/ulc-asnprintf-extra-tests: New file.
* modules/unistdio/ulc-asnprintf-tests (Depends-on): Depend on it.

10 months agou8-asnprintf tests: Add test of %U, %s directives with large arguments.
Bruno Haible [Wed, 19 Jun 2024 18:56:17 +0000 (20:56 +0200)]
u8-asnprintf tests: Add test of %U, %s directives with large arguments.

* tests/unistdio/test-u8-asnprintf-big.c: New file, based on
tests/test-vasnprintf-big.c.
* modules/unistdio/u8-asnprintf-extra-tests: New file.
* modules/unistdio/u8-asnprintf-tests (Depends-on): Depend on it.

10 months agovasnprintf tests: Add test of %s directive with large arguments.
Bruno Haible [Wed, 19 Jun 2024 18:52:08 +0000 (20:52 +0200)]
vasnprintf tests: Add test of %s directive with large arguments.

* tests/test-vasnprintf-big.c: New file.
* modules/vasnprintf-extra-tests: New file.
* modules/vasnprintf-tests (Depends-on): Depend on it.

10 months agovasnprintf, u*-vasnprintf: Support string arguments longer than 2 GiB.
Bruno Haible [Wed, 19 Jun 2024 18:46:47 +0000 (20:46 +0200)]
vasnprintf, u*-vasnprintf: Support string arguments longer than 2 GiB.

* lib/vasnprintf.c: Include <stdint.h>.
(VASNPRINTF): In 64-bit builds, handle the %s directive ourselves.
(local_strnlen): Adjust #if condition.
* modules/unistdio/u8-vasnprintf (Depends-on): Add stdint.
* modules/unistdio/u8-u8-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u16-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u16-u16-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u32-vasnprintf (Depends-on): Likewise.
* modules/unistdio/u32-u32-vasnprintf (Depends-on): Likewise.
* modules/unistdio/ulc-vasnprintf (Depends-on): Likewise.

10 months agovasnwprintf: Optimize handling of %c directive.
Bruno Haible [Wed, 19 Jun 2024 13:20:21 +0000 (15:20 +0200)]
vasnwprintf: Optimize handling of %c directive.

* lib/vasnprintf.c (VASNPRINTF): Use a single ENSURE_ALLOCATION instead
of two.

10 months agou*-vasnprintf: Fix a rare memory leak.
Bruno Haible [Wed, 19 Jun 2024 12:57:40 +0000 (14:57 +0200)]
u*-vasnprintf: Fix a rare memory leak.

* lib/vasnprintf.c (VASNPRINTF): Use ENSURE_ALLOCATION_ELSE instead of
ENSURE_ALLOCATION, to free temporary allocations before failing due to
out-of-memory.

10 months agou*-vasnprintf: Improve comments.
Bruno Haible [Wed, 19 Jun 2024 12:39:02 +0000 (14:39 +0200)]
u*-vasnprintf: Improve comments.

* lib/vasnprintf.c (VASNPRINTF): Improve comments.

10 months agou*-vasnprintf tests: Add more tests of %U, %lU, %llU directives.
Bruno Haible [Wed, 19 Jun 2024 07:27:55 +0000 (09:27 +0200)]
u*-vasnprintf tests: Add more tests of %U, %lU, %llU directives.

* tests/unistdio/test-u8-printf1.h (test_xfunction): Add more tests of
%U, %lU, %llU directives with width and non-ASCII argument.
* tests/unistdio/test-u16-printf1.h (test_xfunction): Likewise.
* tests/unistdio/test-u32-printf1.h (test_xfunction): Likewise.
* tests/unistdio/test-ulc-vasnprintf2.c (test_function): Likewise.
* tests/unistdio/test-ulc-vasnprintf3.c (test_function): Likewise.

10 months agofilemode tests: Tweak.
Bruno Haible [Wed, 19 Jun 2024 07:42:42 +0000 (09:42 +0200)]
filemode tests: Tweak.

* tests/test-filemode.c: Update comment.
* modules/filemode-tests (Depends-on): Add unistd.

10 months agofilemode: Add tests.
Collin Funk [Wed, 19 Jun 2024 04:21:47 +0000 (21:21 -0700)]
filemode: Add tests.

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

10 months agocopysignl tests: Avoid failure on Solaris 11.4.
Bruno Haible [Wed, 19 Jun 2024 00:58:34 +0000 (02:58 +0200)]
copysignl tests: Avoid failure on Solaris 11.4.

* tests/test-copysignl.c: Include <float.h>.
(LDBL_BYTES): New macro.
(main): Use it instead of sizeof (long double).
* modules/copysignl-tests (Depends-on): Add float.

10 months agombsnlen: Add tests.
Bruno Haible [Wed, 19 Jun 2024 00:32:00 +0000 (02:32 +0200)]
mbsnlen: Add tests.

* tests/test-mbsnlen.c: New file.
* tests/test-mbsnlen.sh: New file, based on tests/test-mbsspn.sh.
* modules/mbsnlen-tests: New file.

10 months agombsnlen: Fix bug (regression 2023-09-26).
Bruno Haible [Wed, 19 Jun 2024 00:31:30 +0000 (02:31 +0200)]
mbsnlen: Fix bug (regression 2023-09-26).

* lib/mbsnlen.c (mbsnlen): Fix bug in GNULIB_MCEL_PREFER implementation.

10 months agombslen: Add tests.
Bruno Haible [Tue, 18 Jun 2024 22:45:46 +0000 (00:45 +0200)]
mbslen: Add tests.

* tests/test-mbslen.c: New file.
* tests/test-mbslen.sh: New file, based on tests/test-mbsspn.sh.
* modules/mbslen-tests: New file.

10 months agou*-vasnprintf tests: Add tests of %ls directive.
Bruno Haible [Tue, 18 Jun 2024 17:21:53 +0000 (19:21 +0200)]
u*-vasnprintf tests: Add tests of %ls directive.

* tests/unistdio/test-u8-vasnprintf2.c (test_function): Add tests of
the %ls directive with non-ASCII argument.
* tests/unistdio/test-u8-vasnprintf3.c (test_function): Likewise.
* tests/unistdio/test-u16-vasnprintf2.c (test_function): Likewise.
* tests/unistdio/test-u16-vasnprintf3.c (test_function): Likewise.
* tests/unistdio/test-u32-vasnprintf2.c (test_function): Likewise.
* tests/unistdio/test-u32-vasnprintf3.c (test_function): Likewise.
* tests/unistdio/test-ulc-vasnprintf2.c (test_function): Likewise.
* tests/unistdio/test-ulc-vasnprintf3.c (test_function): Likewise.

10 months agou*-vasnprintf: Fix handling of %ls, %lc directives on Solaris, MSVC.
Bruno Haible [Tue, 18 Jun 2024 17:18:27 +0000 (19:18 +0200)]
u*-vasnprintf: Fix handling of %ls, %lc directives on Solaris, MSVC.

* lib/vasnprintf.c (VASNPRINTF): When implementing the %ls, %lc
directives ourselves: Rename variable 'characters' to 'bytes'. Also
count characters, if necessary for the width handling. Fix
DCHAR_MBSNLEN invocation.

10 months agovasnprintf: Refactor.
Bruno Haible [Tue, 18 Jun 2024 01:16:17 +0000 (03:16 +0200)]
vasnprintf: Refactor.

* lib/vasnprintf.c (VASNPRINTF) [!DCHAR_IS_TCHAR]: Reduce the scope of
the tmpsrc variables.

10 months agonstrftime: tweak volatile access
Paul Eggert [Tue, 18 Jun 2024 15:21:44 +0000 (08:21 -0700)]
nstrftime: tweak volatile access

* lib/strftime.c (utc_timezone): Avoid unnecessary access to volatile.

10 months agonstrftime: Fix crash on NetBSD 10.0.
Bruno Haible [Tue, 18 Jun 2024 12:58:30 +0000 (14:58 +0200)]
nstrftime: Fix crash on NetBSD 10.0.

* lib/strftime.c (utc_timezone_cache): New variable.
(utc_timezone): New function.
(underlying_strftime): Use it when tz is NULL.

10 months agoc-nstrftime: Fix warning on platforms without strftime_l.
Bruno Haible [Tue, 18 Jun 2024 12:27:18 +0000 (14:27 +0200)]
c-nstrftime: Fix warning on platforms without strftime_l.

* lib/strftime.c: Add comment regarding HAVE_STRFTIME_L.
(underlying_strftime): Don't define if this function is not used.
Correct indentation. Simplify #if condition.
(__strftime_internal): Disable code that is not used on platforms
without strftime_l.

10 months agoImprove wording for Y2038 and largefile probes
Paul Eggert [Tue, 18 Jun 2024 04:08:29 +0000 (21:08 -0700)]
Improve wording for Y2038 and largefile probes

This change syncs from Autoconf master.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-06/msg00181.html
* m4/largefile.m4 (_AC_SYS_YEAR2038_PROBE)
(_AC_SYS_LARGEFILE_PROBE): Improve wording of chatter.

10 months agonstrftime: fix bug with -0000 on Solaris 11
Paul Eggert [Tue, 18 Jun 2024 03:47:09 +0000 (20:47 -0700)]
nstrftime: fix bug with -0000 on Solaris 11

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-06/msg00201.html
* lib/strftime.c (strftime) [!_LIBC]: Move #undef up.
(underlying_strftime) [!_LIBC]: New function, containing most of
what __strftime_internal used to do at the underlying_strftime label.
(get_tm_zone): New function, containing much of what
__strftime_internal used to do for %Z.
Be consistent about using "UTC" rather than "GMT";
this changes behavior only on platforms lacking tm_zone.
(__strftime_internal): Use them to compute time zone abbreviation
when needed.  Make ‘zone’ more local, and compute it only if
needed.  Simplify by removing set_and_revert_tz local var and its
uses; no longer needed now that we have get_tm_zone.  Do not
assume %EZ and %OZ are equivalent to %Z.

10 months agonstrftime: Correct indentation.
Bruno Haible [Tue, 18 Jun 2024 00:32:56 +0000 (02:32 +0200)]
nstrftime: Correct indentation.

* lib/strftime.c (__strftime_internal): Correct indentation of
preprocessor directives.

10 months agonstrftime: improve fix for NetBSD link errors
Paul Eggert [Mon, 17 Jun 2024 23:16:29 +0000 (16:16 -0700)]
nstrftime: improve fix for NetBSD link errors

This makes the NetBSD code thread-safe and presumably faster.
* lib/strftime.c (HAVE_NATIVE_TIME_Z): New macro.
(__strftime_internal): If HAVE_NATIVE_TIME_Z, use strftime_lz
or strftime_z instead of setting and reverting TZ.
* lib/time-internal.c: Remove, reverting recent change.
* lib/time_rz.c, modules/time_rz: Also revert recent changes,
since the relevant functions can now remain private to time_rz.c.
* m4/c-nstrftime.m4 (gl_C_GNU_STRFTIME): Check for strftime_lz.
* m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Check for strftime_z.