summaryrefslogtreecommitdiff
path: root/doc/posix-functions/swprintf.texi
Commit message (Collapse)AuthorAgeFilesLines
* vasnwprintf-posix: More details about the glibc bug.Bruno Haible2023-04-091-0/+1
| | | | | | * doc/posix-functions/swprintf.texi: Add comment. * m4/printf.m4 (gl_SWPRINTF_DIRECTIVE_LA): Update cross-compilation guess.
* vasnwprintf-posix: Work around %La bug in glibc 2.15 and Haiku.Bruno Haible2023-04-071-0/+6
| | | | | | | | | | * m4/printf.m4 (gl_SWPRINTF_DIRECTIVE_LA): New macro. * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke gl_SWPRINTF_DIRECTIVE_LA and define NEED_WPRINTF_DIRECTIVE_LA accordingly. * lib/vasnprintf.c: When compiling vasnwprintf, if NEED_WPRINTF_DIRECTIVE_LA, handle the %La and %LA directives ourselves. * doc/posix-functions/swprintf.texi: Mention the %La bug.
* vasnwprintf-posix: Fix behaviour in the C locale.Bruno Haible2023-04-011-0/+4
| | | | | | | | | | | | | | | | * lib/vasnprintf.c (VASNPRINTF): If NEED_WPRINTF_DIRECTIVE_C is set, implement the 'c' directive here. * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke gl_MBRTOWC_C_LOCALE. If mbrtowc is buggy in the C locale, define NEED_WPRINTF_DIRECTIVE_C. * modules/vasnwprintf (Files): Add m4/mbrtowc.m4. * tests/test-vasnwprintf-posix.c (test_function): Add tests of %s and %c in the C locale. * doc/posix-functions/fwprintf.texi: Mention the C locale behaviour bug. * doc/posix-functions/swprintf.texi: Likewise. * doc/posix-functions/vfwprintf.texi: Likewise. * doc/posix-functions/vswprintf.texi: Likewise. * doc/posix-functions/vwprintf.texi: Likewise. * doc/posix-functions/wprintf.texi: Likewise.
* *printf-posix: ISO C 23: Support size specifiers 'wN' and 'wfN'.Bruno Haible2023-03-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/printf-args.h: Include <stdint.h>. (arg_type): Add TYPE_[U]INT8_T, ..., TYPE_[U]INT_FAST64_T and TYPE_COUNT_INT8_T_POINTER, ..., TYPE_COUNT_INT_FAST64_T_POINTER. (argument): Add the union members a_[u]int8_t, ..., a_[u]int_fast64_t and a_count_int8_t_pointer, ..., a_count_int_fast64_t_pointer. * lib/printf-args.c: Include <limits.h>. (PRINTF_FETCHARGS): Handle TYPE_[U]INT8_T, ..., TYPE_[U]INT_FAST64_T and TYPE_COUNT_INT8_T_POINTER, ..., TYPE_COUNT_INT_FAST64_T_POINTER. * lib/printf-parse.c (PRINTF_PARSE): Accept only one size specifier, not a sequence of size specifiers. Accept "wN" and "wfN", where N = 8, 16, 32, 64. * lib/vasnprintf.c (MAX_ROOM_NEEDED, VASNPRINTF): Handle the new TYPE_* values as well. * m4/printf.m4 (gl_PRINTF_SIZES_C23): New macro. * m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_IS_POSIX): Require gl_PRINTF_SIZES_C23. Test gl_cv_func_printf_sizes_c23. * m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_IS_POSIX): Likewise. * m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_IS_POSIX): Likewise. * m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_IS_POSIX): Likewise. * m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_IS_POSIX): Likewise. * m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_IS_POSIX): Likewise. * m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_IS_POSIX): Likewise. * m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_IS_POSIX): Likewise. * m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_IS_POSIX): Likewise. * m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_IS_POSIX): Likewise. * m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_IS_POSIX): Likewise. * tests/test-vasnprintf-posix.c (test_function): Add tests for size specifiers with %d, %u, %b, %o, %x. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnwprintf-posix.c (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise. * modules/vasnprintf (Depends-on): Add limits-h. * modules/vasnwprintf (Depends-on): Add limits-h. * modules/c-vasnprintf (Depends-on): Add limits-h, stdint. * modules/unistdio/u-printf-args (Depends-on): Add stdint, limits-h. * doc/posix-functions/dprintf.texi: Mention the ISO C 23 size specifiers. * doc/posix-functions/fprintf.texi: Likewise. * doc/posix-functions/fwprintf.texi: Likewise. * doc/posix-functions/printf.texi: Likewise. * doc/posix-functions/snprintf.texi: Likewise. * doc/posix-functions/sprintf.texi: Likewise. * doc/posix-functions/swprintf.texi: Likewise. * doc/posix-functions/vdprintf.texi: Likewise. * doc/posix-functions/vfprintf.texi: Likewise. * doc/posix-functions/vfwprintf.texi: Likewise. * doc/posix-functions/vprintf.texi: Likewise. * doc/posix-functions/vsnprintf.texi: Likewise. * doc/posix-functions/vsprintf.texi: Likewise. * doc/posix-functions/vswprintf.texi: Likewise. * doc/posix-functions/vwprintf.texi: Likewise. * doc/posix-functions/wprintf.texi: Likewise.
* vasnwprintf: Fix test failures on FreeBSD, NetBSD, AIX, mingw.Bruno Haible2023-03-221-0/+7
| | | | | | | | | | | | | * m4/printf.m4 (gl_SWPRINTF_WORKS): New macro. * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke it and define HAVE_WORKING_SWPRINTF accordingly. * lib/vasnprintf.c: Together with HAVE_SWPRINTF, test also HAVE_WORKING_SWPRINTF. (VASNPRINTF): If WIDE_CHAR_VERSION && !DCHAR_IS_TCHAR, don't pass a wchar_t[] to snprintf. Add a workaround against mingw's snwprintf function. * doc/posix-functions/swprintf.texi: Document the null wide character bug.
* vasnwprintf: Fix test failures on musl libc.Bruno Haible2023-03-201-0/+10
| | | | | | | | | | * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke gl_MUSL_LIBC. * lib/vasnprintf.c (VASNPRINTF): On musl libc, when WIDE_CHAR_VERSION, - force pad_ourselves to be 1, - don't use %n. Fix zero-padding when the result starts with a prefix "0x" or "0b". * modules/vasnwprintf (Files): Add musl.m4. * doc/posix-functions/swprintf.texi: Mention two musl libc bugs.
* *printf-posix: ISO C 23: Add %b directive for binary output of integers.Bruno Haible2023-03-171-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/printf-parse.c (PRINTF_PARSE): Recognize the 'b' directive. * lib/printf-parse.h: Update comment. * lib/wprintf-parse.h: Likewise. * lib/vasnprintf.c (MAX_ROOM_NEEDED, VASNPRINTF): Add support for the 'b' directive. * m4/printf.m4 (gl_PRINTF_DIRECTIVE_B): New macro. * m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_DIRECTIVE_B): New macro. (gl_PREREQ_VASNPRINTF_WITH_EXTRAS): Invoke it. * m4/vasnwprintf-posix.m4 (gl_FUNC_VASNWPRINTF_POSIX): Invoke gl_PREREQ_VASNPRINTF_DIRECTIVE_B. * m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_POSIX): Require gl_PRINTF_DIRECTIVE_B and test its result. Invoke gl_PREREQ_VASNPRINTF_DIRECTIVE_B. * m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_POSIX): Likewise. * m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_POSIX): Likewise. * m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_POSIX): Likewise. * m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_POSIX): Likewise. * m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_POSIX): Likewise. * m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_POSIX): Likewise. * m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_POSIX): Likewise. * m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_POSIX): Likewise. * m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_POSIX): Likewise. * m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_POSIX): Likewise. * tests/test-snprintf-posix.h (test_function): Add some tests of the %b directive. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnprintf-posix.c (test_function): Likewise. * tests/test-vasnwprintf-posix.c (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise. * doc/glibc-functions/asprintf.texi: Mention the 'b' directive. * doc/glibc-functions/obstack_printf.texi: Likewise. * doc/glibc-functions/obstack_vprintf.texi: Likewise. * doc/glibc-functions/vasprintf.texi: Likewise. * doc/posix-functions/dprintf.texi: Likewise. * doc/posix-functions/fprintf.texi: Likewise. * doc/posix-functions/fwprintf.texi: Likewise. * doc/posix-functions/printf.texi: Likewise. * doc/posix-functions/snprintf.texi: Likewise. * doc/posix-functions/sprintf.texi: Likewise. * doc/posix-functions/swprintf.texi: Likewise. * doc/posix-functions/vdprintf.texi: Likewise. * doc/posix-functions/vfprintf.texi: Likewise. * doc/posix-functions/vfwprintf.texi: Likewise. * doc/posix-functions/vprintf.texi: Likewise. * doc/posix-functions/vsnprintf.texi: Likewise. * doc/posix-functions/vsprintf.texi: Likewise. * doc/posix-functions/vswprintf.texi: Likewise. * doc/posix-functions/vwprintf.texi: Likewise. * doc/posix-functions/wprintf.texi: Likewise.
* doc: Update for macOS 11.1.Bruno Haible2021-03-211-1/+1
| | | | | | | | | | * doc/posix-headers/*.texi: Update. * doc/glibc-headers/*.texi: Update. * doc/posix-functions/*.texi: Likewise. * doc/pastposix-functions/*.texi: Likewise. * doc/glibc-functions/*.texi: Likewise. * m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Update cross-compilation guess.
* doc: Update for Mac OS X 10.13.Bruno Haible2020-07-251-1/+1
| | | | | | | | | * doc/*/*.texi: Update. * m4/expm1l.m4: Update comments. * m4/getgroups.m4: Likewise. * m4/getlogin_r.m4: Likewise. * m4/linkat.m4: Likewise. * m4/printf.m4: Likewise.
* *printf-posix: Document why it's overridden on some glibc systems.Bruno Haible2020-03-081-0/+1
| | | | | | | | | | Reported by Adrian Bunk <bunk@stusta.de> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00011.html>. * doc/posix-functions/*printf.texi: Document the problem with the %n directive on some glibc systems. * m4/printf.m4 (gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N): Adjust the cross-compilation guesses accordingly.
* doc: Update documentation about wchar_t.Bruno Haible2020-01-011-1/+1
| | | | | * doc/*/*wc*.texi: Clarify that 64-bit AIX does not have a too small wchar_t type.
* Update some URLsPaul Eggert2019-09-221-1/+1
| | | | | | This is a clerical change that mostly changes http: to https: in URLs where either will work. It also updates some URLs that have moved, removes some URLs that no longer work, and fixes related text.
* doc: Remove documentation of Solaris 8 and older as supported platforms.Bruno Haible2019-07-061-1/+1
| | | | | | | | | | | | * doc/gnulib-intro.texi (Target Platforms): Mention that Solaris <= 8 is unsupported. * doc/posix-functions/mbrtowc.texi: Don't mention Solaris specific workarounds. * doc/posix-functions/memcmp.texi: Likewise. * doc/posix-functions/rename.texi: Likewise. * doc/posix-functions/tzset.texi: Likewise. * doc/posix-headers/wctype.texi: Likewise. * doc/**/*.texi: Update.
* doc: Remove documentation of Interix 3.5 as a supported platform.Bruno Haible2019-07-061-1/+1
| | | | * doc/**/*.texi: Update.
* doc: Remove documentation of BeOS as a supported platform.Bruno Haible2019-07-061-1/+1
| | | | | | | | * doc/gnulib-intro.texi (Target Platforms): Mention that BeOS is unsupported. * doc/*-functions/*printf.texi: Don't mention BeOS specific workarounds. * doc/posix-functions/getdelim.texi: Likewise. * doc/**/*.texi: Update.
* docs: mention printf %m considerationsEric Blake2018-11-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc -Wformat does NOT flag printf("%m") on a BSD system, even though it prints only "m" instead of the desired GNU/Linux behavior of the current errno value (you have to use -Wpedantic to flag it, but that's a rather heavy hammer). Still, it's easy enough (even if verbose) to write out strerror() usage directly, to the point that gnulib will probably never provide a module to guarantee %m everywhere. See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270 * doc/glibc-functions/asprintf.texi (asprintf): Document that %m is not portable, and is easy enough to work around. * doc/glibc-functions/obstack_printf.texi (obstack_printf): Likewise. * doc/glibc-functions/obstack_vprintf.texi (obstack_vprintf): Likewise. * doc/glibc-functions/vasprintf.texi (vasprintf): Likewise. * doc/posix-functions/dprintf.texi (dprintf): Likewise. * doc/posix-functions/fprintf.texi (fprintf): Likewise. * doc/posix-functions/fwprintf.texi (fwprintf): Likewise. * doc/posix-functions/printf.texi (printf): Likewise. * doc/posix-functions/snprintf.texi (snprintf): Likewise. * doc/posix-functions/sprintf.texi (sprintf): Likewise. * doc/posix-functions/swprintf.texi (swprintf): Likewise. * doc/posix-functions/vdprintf.texi (vdprintf): Likewise. * doc/posix-functions/vfprintf.texi (vfprintf): Likewise. * doc/posix-functions/vfwprintf.texi (vfwprintf): Likewise. * doc/posix-functions/vprintf.texi (vprintf): Likewise. * doc/posix-functions/vsnprintf.texi (vsnprintf): Likewise. * doc/posix-functions/vsprintf.texi (vsprintf): Likewise. * doc/posix-functions/vswprintf.texi (vswprintf): Likewise. * doc/posix-functions/vwprintf.texi (vwprintf): Likewise. * doc/posix-functions/wprintf.texi (wprintf): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* doc: Update for MSVC 14.Bruno Haible2017-07-061-1/+7
| | | | | | | | * doc/posix-headers/*.texi: Add info about MSVC 14. * doc/posix-functions/*.texi: Likewise. * doc/pastposix-functions/*.texi: Likewise. * doc/glibc-headers/*.texi: Likewise. * doc/glibc-functions/*.texi: Likewise.
* doc: Mention NetBSD bugs.Bruno Haible2012-01-051-0/+4
| | | | | * doc/posix-functions/*printf.texi: Mention a NetBSD 5.1 bug. * doc/posix-functions/nl_langinfo.texi: Mention another NetBSD 5.1 bug.
* *printf: Add support for MSVC compiler.Bruno Haible2011-09-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * m4/printf.m4 (gl_PRINTF_DIRECTIVE_N): On MSVC, install a handler that handles the exception caused by the %n directive. When cross-compiling, guess no on native Windows. (gl_SNPRINTF_TRUNCATION_C99, gl_SNPRINTF_RETVAL_C99, gl_SNPRINTF_DIRECTIVE_N, gl_SNPRINTF_SIZE1): When snprintf is missing, emulate it through vsnprintf. * m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_POSIX): Update comment. * doc/posix-functions/dprintf.texi: Update documentation regarding MSVC 9. * doc/posix-functions/fprintf.texi: Likewise. * doc/posix-functions/printf.texi: Likewise. * doc/posix-functions/snprintf.texi: Likewise. * doc/posix-functions/sprintf.texi: Likewise. * doc/posix-functions/swprintf.texi: Likewise. * doc/posix-functions/vdprintf.texi: Likewise. * doc/posix-functions/vfprintf.texi: Likewise. * doc/posix-functions/vprintf.texi: Likewise. * doc/posix-functions/vsnprintf.texi: Likewise. * doc/posix-functions/vsprintf.texi: Likewise. * doc/glibc-functions/asprintf.texi: Likewise. * doc/glibc-functions/obstack_printf.texi: Likewise. * doc/glibc-functions/obstack_vprintf.texi: Likewise. * doc/glibc-functions/vasprintf.texi: Likewise.
* Documentation about Minix.Bruno Haible2011-07-311-1/+1
| | | | | | | * doc/posix-headers/*.texi: Add info about Minix 3.1.8. * doc/glibc-headers/*.texi: Likewise. * doc/posix-functions/*.texi: Likewise. * doc/glibc-functions/*.texi: Likewise.
* avoid some overlong lines from posix urls, etc.Karl Berry2010-08-131-1/+1
|
* doc: mention more functions added in cygwin 1.7.0Eric Blake2009-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * doc/posix-functions/fwprintf.texi: Mention recent cygwin 1.7.0 addition. * doc/posix-functions/fwscanf.texi: Likewise. * doc/posix-functions/swprintf.texi: Likewise. * doc/posix-functions/swscanf.texi: Likewise. * doc/posix-functions/vfwprintf.texi: Likewise. * doc/posix-functions/vfwscanf.texi: Likewise. * doc/posix-functions/vswprintf.texi: Likewise. * doc/posix-functions/vswscanf.texi: Likewise. * doc/posix-functions/vwprintf.texi: Likewise. * doc/posix-functions/vwscanf.texi: Likewise. * doc/posix-functions/wcscasecmp.texi: Likewise. * doc/posix-functions/wcsdup.texi: Likewise. * doc/posix-functions/wcsftime.texi: Likewise. * doc/posix-functions/wcsncasecmp.texi: Likewise. * doc/posix-functions/wprintf.texi: Likewise. * doc/posix-functions/wscanf.texi: Likewise. * doc/glibc-functions/gethostbyname2.texi: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* Mention that AIX has a crippled wchar_t type.Bruno Haible2008-12-211-1/+1
|
* Update for HP-UX 11.11.Bruno Haible2008-12-211-1/+1
|
* Refer to new POSIX:2008 standard.Bruno Haible2008-12-141-1/+1
|
* Rename two directories: headers -> posix-headers, functions -> posix-functions.Bruno Haible2008-01-201-0/+23