|
From: | Bruno Haible |
Subject: | new modules *printf-gnu |
Date: | Fri, 24 Mar 2023 12:37:42 +0100 |
Eric Blake wrote in <https://lists.gnu.org/archive/html/bug-gnulib/2023-03/msg00060.html>: > C23 admits that %#B is not available for > portable use of outputting uppercase '0B...', you would have to > manually write 0B%b instead. However, since glibc DOES support %B as > the uppercase counterpart to %b, should we add that in gnulib (but > this time under the auspices of *printf-gnu, rather than > *printf-posix)? Nice idea. I was pondering what to do with the wording in ISO C23 "Implementations that did not use an uppercase B as their own extension before are encouraged to implement it similar to conversion specifier b as standardized above, with the alternative form (#B) generating 0B as prefix for nonzero values." "encouraged" - should we add it to the *printf-posix modules or not? Your suggestion to put it under *printf-gnu, that being an extension of *printf-posix, makes perfect sense, since glibc implements %B since version 2.35. Implemented as follows. 2023-03-24 Bruno Haible <bruno@clisp.org> xprintf-gnu: New module. * modules/xprintf-gnu: New file, based on modules/vasnprintf-gnu and modules/xprintf-posix. 2023-03-24 Bruno Haible <bruno@clisp.org> xvasprintf-gnu: New module. * modules/xvasprintf-gnu: New file, based on modules/xvasprintf-posix. 2023-03-24 Bruno Haible <bruno@clisp.org> vasnwprintf-gnu: Add tests. * tests/test-vasnwprintf-gnu.c: New file, based on tests/test-vasnwprintf-posix.c and tests/test-vasnprintf-gnu.c. * modules/vasnwprintf-gnu-tests: New file, based on modules/vasnwprintf-posix-tests. vasnwprintf-gnu: New module. * m4/vasnwprintf-posix.m4 (gl_FUNC_VASNWPRINTF_IS_POSIX): New macro. (gl_FUNC_VASNWPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vasnwprintf-gnu.m4: New file, based on m4/vasnprintf-gnu.m4. * modules/vasnwprintf-gnu: New file, based on modules/vasnprintf-gnu. 2023-03-24 Bruno Haible <bruno@clisp.org> obstack-printf-gnu: Add tests. * modules/obstack-printf-gnu-tests: New file, based on modules/obstack-printf-posix-tests. obstack-printf-gnu: New module. * m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_IS_POSIX): New macro, extracted from gl_FUNC_OBSTACK_PRINTF_POSIX. (gl_FUNC_OBSTACK_PRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/obstack-printf-gnu.m4: New file, based on m4/obstack-printf-posix.m4. * modules/obstack-printf-gnu: New file, based on modules/vasnprintf-gnu. * doc/glibc-functions/obstack_printf.texi: Mention the new module. * doc/glibc-functions/obstack_vprintf.texi: Likewise. 2023-03-24 Bruno Haible <bruno@clisp.org> dprintf-gnu: Add tests. * tests/test-dprintf-gnu.sh: New file, based on tests/test-dprintf-posix.sh. * tests/test-dprintf-gnu.c: New file, based on tests/test-vasnprintf-gnu.c. * modules/dprintf-gnu-tests: New file, based on modules/dprintf-posix-tests. dprintf-gnu: New module. * m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_DPRINTF_POSIX. (gl_FUNC_DPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/dprintf-gnu.m4: New file, based on m4/dprintf-posix.m4. * modules/dprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/dprintf.texi: Mention the new module. 2023-03-24 Bruno Haible <bruno@clisp.org> vdprintf-gnu: Add tests. * tests/test-vdprintf-gnu.sh: New file, based on tests/test-vdprintf-posix.sh. * tests/test-vdprintf-gnu.c: New file, based on tests/test-vdprintf-posix.c. * modules/vdprintf-gnu-tests: New file, based on modules/vdprintf-posix-tests. vdprintf-gnu: New module. * m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_VDPRINTF_POSIX. (gl_FUNC_VDPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vdprintf-gnu.m4: New file, based on m4/vdprintf-posix.m4. * modules/vdprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/vdprintf.texi: Mention the new module. 2023-03-24 Bruno Haible <bruno@clisp.org> printf-gnu: Add tests. * tests/test-printf-gnu.sh: New file, based on tests/test-printf-posix.sh. * tests/test-printf-gnu.c: New file, based on tests/test-printf-posix.c. * modules/printf-gnu-tests: New file, based on modules/printf-posix-tests. printf-gnu: New module. * m4/printf-posix.m4: Renamed from m4/printf-posix-rpl.m4. (gl_FUNC_PRINTF_IS_POSIX): New macro. (gl_FUNC_PRINTF_POSIX): Require it. Don't require gl_FUNC_VFPRINTF_POSIX. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS and gl_REPLACE_VASNPRINTF. * m4/printf-gnu.m4: New file, based on m4/fprintf-posix.m4. * modules/printf-posix (Files): Update. * modules/printf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/printf.texi: Mention the new module. 2023-03-24 Bruno Haible <bruno@clisp.org> vprintf-gnu: Add tests. * tests/test-vprintf-gnu.sh: New file, based on tests/test-vprintf-posix.sh. * tests/test-vprintf-gnu.c: New file, based on tests/test-vprintf-posix.c. * tests/test-printf-gnu.h: New file, based on tests/test-vasnprintf-gnu.c. * modules/vprintf-gnu-tests: New file, based on modules/vprintf-posix-tests. vprintf-gnu: New module. * m4/vprintf-posix.m4 (gl_FUNC_VPRINTF_IS_POSIX): New macro. (gl_FUNC_VPRINTF_POSIX): Require it. Don't require gl_FUNC_VFPRINTF_POSIX. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS and gl_REPLACE_VASNPRINTF. * m4/vprintf-gnu.m4: New file, based on m4/vfprintf-posix.m4. * modules/vprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/vprintf.texi: Mention the new module. 2023-03-24 Bruno Haible <bruno@clisp.org> fprintf-gnu: Add tests. * tests/test-fprintf-gnu.sh: New file, based on tests/test-fprintf-posix.sh. * tests/test-fprintf-gnu.c: New file, based on tests/test-fprintf-posix.c. * modules/fprintf-gnu-tests: New file, based on modules/fprintf-posix-tests. fprintf-gnu: New module. * m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_FPRINTF_POSIX. (gl_FUNC_FPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/fprintf-gnu.m4: New file, based on m4/fprintf-posix.m4. * modules/fprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/fprintf.texi: Mention the new module. 2023-03-24 Bruno Haible <bruno@clisp.org> vfprintf-gnu: Add tests. * tests/test-vfprintf-gnu.sh: New file, based on tests/test-vfprintf-posix.sh. * tests/test-vfprintf-gnu.c: New file, based on tests/test-vfprintf-posix.c. * tests/test-fprintf-gnu.h: New file, based on tests/test-vasnprintf-gnu.c. * tests/test-printf-gnu.output: New file, based on tests/test-vasnprintf-gnu.c. * modules/vfprintf-gnu-tests: New file, based on modules/vfprintf-posix-tests. vfprintf-gnu: New module. * m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_VFPRINTF_POSIX. (gl_FUNC_VFPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vfprintf-gnu.m4: New file, based on m4/vfprintf-posix.m4. * modules/vfprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/vfprintf.texi: Mention the new module. 2023-03-24 Bruno Haible <bruno@clisp.org> vasprintf-gnu: Add tests. * tests/test-vasprintf-gnu.c: New file, based on tests/test-vasprintf-posix.c and tests/test-vasnprintf-gnu.c. * modules/vasprintf-gnu-tests: New file, based on modules/vasprintf-posix-tests. vasprintf-gnu: New module. * m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_VASPRINTF_POSIX. (gl_FUNC_VASPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vasprintf-gnu.m4: New file, based on m4/vasprintf-posix.m4. * modules/vasprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/glibc-functions/vasprintf.texi: Mention the new module. * doc/glibc-functions/asprintf.texi: Likewise. 2023-03-24 Bruno Haible <bruno@clisp.org> sprintf-gnu: Add tests. * tests/test-sprintf-gnu.c: New file, based on tests/test-sprintf-posix.c. * modules/sprintf-gnu-tests: New file, based on modules/sprintf-posix-tests. sprintf-gnu: New module. * m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_SPRINTF_POSIX. (gl_FUNC_SPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/sprintf-gnu.m4: New file, based on m4/sprintf-posix.m4. * modules/sprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/sprintf.texi: Mention the new module. 2023-03-24 Bruno Haible <bruno@clisp.org> vsprintf-gnu: Add tests. * tests/test-vsprintf-gnu.c: New file, based on tests/test-vsprintf-posix.c. * tests/test-sprintf-gnu.h: New file, based on tests/test-vasnprintf-gnu.c. * modules/vsprintf-gnu-tests: New file, based on modules/vsprintf-posix-tests. vsprintf-gnu: New module. * m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_VSPRINTF_POSIX. (gl_FUNC_VSPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vsprintf-gnu.m4: New file, based on m4/vsprintf-posix.m4. * modules/vsprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/vsprintf.texi: Mention the new module. 2023-03-24 Bruno Haible <bruno@clisp.org> snprintf-gnu: Add tests. * tests/test-snprintf-gnu.c: New file, based on tests/test-snprintf-posix.c. * modules/snprintf-gnu-tests: New file, based on modules/snprintf-posix-tests. snprintf-gnu: New module. * m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_SNPRINTF_POSIX. (gl_FUNC_SNPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/snprintf-gnu.m4: New file, based on m4/snprintf-posix.m4. * modules/snprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/snprintf.texi: Mention the new module. 2023-03-24 Bruno Haible <bruno@clisp.org> vsnprintf-gnu: Add tests. * tests/test-vsnprintf-gnu.c: New file, based on tests/test-vsnprintf-posix.c. * tests/test-snprintf-gnu.h: New file, based on tests/test-vasnprintf-gnu.c. * modules/vsnprintf-gnu-tests: New file, based on modules/vsnprintf-posix-tests. vsnprintf-gnu: New module. * m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_VSNPRINTF_POSIX. (gl_FUNC_VSNPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vsnprintf-gnu.m4: New file, based on m4/vsnprintf-posix.m4. * modules/vsnprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/vsnprintf.texi: Mention the new module. 2023-03-23 Bruno Haible <bruno@clisp.org> vasnprintf-gnu: Add tests. * tests/test-vasnprintf-gnu.c: New file, based on tests/test-vasnprintf-posix.c. * modules/vasnprintf-gnu-tests: New file. vasnprintf-gnu: New module. Suggested by Eric Blake in <https://lists.gnu.org/archive/html/bug-gnulib/2023-03/msg00060.html>. * lib/printf-parse.c (PRINTF_PARSE): Recognize the 'B' conversion. * lib/printf-parse.h: Update comments. * lib/wprintf-parse.h: Likewise. * lib/vasnprintf.c (MAX_ROOM_NEEDED): Treat the 'B' conversion like 'b'. (VASNPRINTF): Implement 'B' conversion if NEED_PRINTF_DIRECTIVE_UPPERCASE_B is set. Support the 'B' conversion if requested. * m4/printf.m4 (gl_PRINTF_DIRECTIVE_B): When cross-compiling, guess yes on glibc >= 2.35. (gl_PRINTF_DIRECTIVE_UPPERCASE_B): New macro. * m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS): Renamed from gl_PREREQ_VASNPRINTF_WITH_EXTRAS. (gl_PREREQ_VASNPRINTF_DIRECTIVE_UPPERCASE_B, gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS): New macros. * m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_VASNPRINTF_POSIX. (gl_FUNC_VASNPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vasnprintf-gnu.m4: New file. * modules/vasnprintf-gnu: New file. * modules/c-vasnprintf (configure.ac): Update. * modules/unistdio/u8-vasnprintf (configure.ac): Likewise. * modules/unistdio/u8-u8-vasnprintf (configure.ac): Likewise. * modules/unistdio/u16-vasnprintf (configure.ac): Likewise. * modules/unistdio/u16-u16-vasnprintf (configure.ac): Likewise. * modules/unistdio/u32-vasnprintf (configure.ac): Likewise. * modules/unistdio/u32-u32-vasnprintf (configure.ac): Likewise. * modules/unistdio/ulc-vasnprintf (configure.ac): Likewise. 2023-03-23 Bruno Haible <bruno@clisp.org> printf-posix tests: Fix compilation error (regression 2021-08-28). * modules/printf-posix-tests (Files): Add tests/qemu.h.
0001-printf-posix-tests-Fix-compilation-error-regression-.patch
Description: Text Data
0002-vasnprintf-gnu-New-module.patch
Description: Text Data
0003-vasnprintf-gnu-Add-tests.patch
Description: Text Data
0004-vsnprintf-gnu-New-module.patch
Description: Text Data
0005-vsnprintf-gnu-Add-tests.patch
Description: Text Data
0006-snprintf-gnu-New-module.patch
Description: Text Data
0007-snprintf-gnu-Add-tests.patch
Description: Text Data
0008-vsprintf-gnu-New-module.patch
Description: Text Data
0009-vsprintf-gnu-Add-tests.patch
Description: Text Data
0010-sprintf-gnu-New-module.patch
Description: Text Data
0011-sprintf-gnu-Add-tests.patch
Description: Text Data
0012-vasprintf-gnu-New-module.patch
Description: Text Data
0013-vasprintf-gnu-Add-tests.patch
Description: Text Data
0014-vfprintf-gnu-New-module.patch
Description: Text Data
0015-vfprintf-gnu-Add-tests.patch
Description: Text Data
0016-fprintf-gnu-New-module.patch
Description: Text Data
0017-fprintf-gnu-Add-tests.patch
Description: Text Data
0018-vprintf-gnu-New-module.patch
Description: Text Data
0019-vprintf-gnu-Add-tests.patch
Description: Text Data
0020-printf-gnu-New-module.patch
Description: Text Data
0021-printf-gnu-Add-tests.patch
Description: Text Data
0022-vdprintf-gnu-New-module.patch
Description: Text Data
0023-vdprintf-gnu-Add-tests.patch
Description: Text Data
0024-dprintf-gnu-New-module.patch
Description: Text Data
0025-dprintf-gnu-Add-tests.patch
Description: Text Data
0026-obstack-printf-gnu-New-module.patch
Description: Text Data
0027-obstack-printf-gnu-Add-tests.patch
Description: Text Data
0028-vasnwprintf-gnu-New-module.patch
Description: Text Data
0029-vasnwprintf-gnu-Add-tests.patch
Description: Text Data
0030-xvasprintf-gnu-New-module.patch
Description: Text Data
0031-xprintf-gnu-New-module.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |