summaryrefslogtreecommitdiff
path: root/tests/test-sprintf-posix.h
Commit message (Collapse)AuthorAgeFilesLines
* vasnprintf-posix: Fix crash in narrow %lc directive (regr. 2023-03-21).Bruno Haible2023-04-011-0/+16
| | | | | | | | | | | * lib/vasnprintf.c (VASNPRINTF): Negative results of local_wcrtomb can now occur; handle them. * tests/test-vasnprintf-posix.c (test_function): Test %lc directive with a wint_t argument that is not a valid wide character. * 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.
* *printf-posix: ISO C 23: Support size specifiers 'wN' and 'wfN'.Bruno Haible2023-03-241-0/+470
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* *printf-posix: Fix implementation of %b directive.Bruno Haible2023-03-221-0/+270
| | | | | | | | | | | | | | * lib/vasnprintf.c (VASNPRINTF): In the %b directive implementation, fix the precision handling, and ignore the '0' flag when a width and a precision are both present. * tests/test-snprintf-posix.h (test_function): Add test cases for the %x directive and more test cases for 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. * modules/vasnwprintf-posix-tests (Files): Add m4/musl.m4. (configure.ac): Invoke gl_MUSL_LIBC.
* *printf-posix: Work around bug with %lc of 0 on many platforms.Bruno Haible2023-03-211-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/vasnprintf.c (local_wctomb): Define also for NEED_PRINTF_DIRECTIVE_LC. (VASNPRINTF): Implement %lc handling ourselves if NEED_PRINTF_DIRECTIVE_LC. * m4/printf.m4 (gl_PRINTF_DIRECTIVE_LC): New macro. * m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_DIRECTIVE_LC): New macro. (gl_PREREQ_VASNPRINTF_WITH_EXTRAS): Invoke it. * m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_POSIX): Require gl_PRINTF_DIRECTIVE_LC and test its result. Invoke gl_PREREQ_VASNPRINTF_DIRECTIVE_LC. * 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 more tests for the %c and %lc directives. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnprintf-posix.c (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise. * doc/glibc-functions/asprintf.texi: Mention the %lc 0 bug. * 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/printf.texi: Likewise. * doc/posix-functions/snprintf.texi: Likewise. * doc/posix-functions/sprintf.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.
* *printf-posix: ISO C 23: Add %b directive for binary output of integers.Bruno Haible2023-03-171-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* vasnprintf-posix: Fix possible bug with negative width handling for %lc.Bruno Haible2023-01-281-0/+62
| | | | | | | | | | | | * lib/vasnprintf.c (VASNPRINTF): In the code for %lc in vasnprintf, test for the FLAG_LEFT bit in the flags variable. * tests/test-vasnprintf-posix.c (test_function): Add tests for width given as argument for the directives %c, %lc. * tests/test-vasprintf-posix.c (test_function): Likewise. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-snprintf-posix.c: Include <wchar.h>, for wint_t. * tests/test-sprintf-posix.c: Likewise.
* vasnprintf-posix: Fix negative width handling for %ls directive.Bruno Haible2023-01-281-0/+60
| | | | | | | | | | | | Reported by clang via Po Lu <luangruo@yahoo.com>. * lib/vasnprintf.c (VASNPRINTF): In the code for %ls in vasnprintf and for %s in vasnwprintf, test for the FLAG_LEFT bit in the flags variable. * tests/test-vasnprintf-posix.c (test_function): Add tests for width given as argument for the directives %s, %ls. * tests/test-vasprintf-posix.c (test_function): Likewise. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise.
* vasnprintf-posix: Add more unit tests.Bruno Haible2023-01-281-0/+128
| | | | | | | | * tests/test-vasnprintf-posix.c (test_function): Add tests for width given as argument for the directives %a, %f, %e, %g. * tests/test-vasprintf-posix.c (test_function): Likewise. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise.
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-051-1/+1
| | | | | | | | | See: https://www.gnu.org/licenses/gpl-3.0.html#howto Run: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * All files using GPLv3: Adjust via the above command.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* maint: shorten https://lists.gnu.org/archive/html/... linksJim Meyering2017-11-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each /archive/html/ part can be replace with /r/. Run this to induce the change: git grep -l archive/html|xargs perl -pi -e 's,/archive/html/,/r/,g' * ChangeLog: Perform that substitution. * Makefile: Likewise. * STATUS-libposix: Likewise. * build-aux/bootstrap: Likewise. * doc/maintain.texi: Likewise. * gnulib-tool: Likewise. * lib/allocator.h: Likewise. * lib/argp-ba.c: Likewise. * lib/argp-pv.c: Likewise. * lib/canon-host.c: Likewise. * lib/canonicalize-lgpl.c: Likewise. * lib/float.in.h: Likewise. * lib/fstat.c: Likewise. * lib/getdelim.c: Likewise. * lib/getprogname.c: Likewise. * lib/glthread/thread.h: Likewise. * lib/intprops.h: Likewise. * lib/mbsrtowcs-state.c: Likewise. * lib/safe-read.c: Likewise. * lib/signal.in.h: Likewise. * lib/stat.c: Likewise. * lib/stdbool.in.h: Likewise. * lib/stdio-impl.h: Likewise. * lib/stdio.in.h: Likewise. * lib/sysexits.in.h: Likewise. * lib/timespec.h: Likewise. * lib/wcsrtombs-state.c: Likewise. * m4/alloca.m4: Likewise. * m4/extern-inline.m4: Likewise. * m4/fstatat.m4: Likewise. * m4/gnulib-common.m4: Likewise. * m4/lib-ignore.m4: Likewise. * m4/printf.m4: Likewise. * m4/regex.m4: Likewise. * m4/stat-size.m4: Likewise. * m4/std-gnu11.m4: Likewise. * m4/stdbool.m4: Likewise. * m4/sys_types_h.m4: Likewise. * m4/threadlib.m4: Likewise. * m4/vararrays.m4: Likewise. * pygnulib/GLImport.py: Likewise. * tests/test-exp.h: Likewise. * tests/test-exp2.h: Likewise. * tests/test-expm1.h: Likewise. * tests/test-fflush2.c: Likewise. * tests/test-getopt_long.h: Likewise. * tests/test-intprops.c: Likewise. * tests/test-log.h: Likewise. * tests/test-log10.h: Likewise. * tests/test-log1p.h: Likewise. * tests/test-log2.h: Likewise. * tests/test-printf-posix.h: Likewise. * tests/test-regex.c: Likewise. * tests/test-snprintf-posix.h: Likewise. * tests/test-sprintf-posix.h: Likewise. * tests/test-stdalign.c: Likewise. * tests/test-stdbool.c: Likewise. * tests/test-vasnprintf-posix.c: Likewise. * tests/test-vasprintf-posix.c: Likewise. * top/maint.mk: Likewise.
* all: Replace many more http URLs by https URLs. Update stale URLs.Bruno Haible2017-09-141-5/+5
| | | | | * users.txt: Remove mention of 'newts'. * lib/localename.c: Update comment about LANG_SOTHO.
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* printf, isinf, etc.: noncanonical != NaNPaul Eggert2015-02-201-344/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not require that isinf, printf, etc. treat noncanonical values as NaNs. Instead, require only that they do not crash. Problem reported by Joseph Myers in: https://sourceware.org/ml/libc-alpha/2015-02/msg00244.html * doc/posix-functions/dprintf.texi (dprintf): * doc/posix-functions/fprintf.texi (fprintf): * doc/posix-functions/isfinite.texi (isfinite): * doc/posix-functions/isinf.texi (isinf): * doc/posix-functions/isnan.texi (isnan): * doc/posix-functions/printf.texi (printf): * doc/posix-functions/snprintf.texi (snprintf): * doc/posix-functions/sprintf.texi (sprintf): * doc/posix-functions/vdprintf.texi (vdprintf): * doc/posix-functions/vfprintf.texi (vfprintf): * doc/posix-functions/vprintf.texi (vprintf): * doc/posix-functions/vsnprintf.texi (vsnprintf): * doc/posix-functions/vsprintf.texi (vsprintf): Document this. * m4/isfinite.m4 (gl_ISFINITEL_WORKS): * m4/isinf.m4 (gl_ISINFL_WORKS): * m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): * m4/printf.m4 (gl_PRINTF_INFINITE_LONG_DOUBLE): * tests/test-isfinite.c (test_isfinitel): * tests/test-isinf.c (test_isinfl): * tests/test-isnan.c (test_long_double): * tests/test-isnanl.h (main): * tests/test-snprintf-posix.h (test_function): * tests/test-sprintf-posix.h (test_function): * tests/test-vasnprintf-posix.c (test_function): * tests/test-vasprintf-posix.c (test_function): o Test only that noncanonical values do not cause crashes, not that they are treated as NaNs. In some cases this means a larger output buffer is needed.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* Fix LDBL80_WORDS macro on big endian platforms.Bruno Haible2014-12-051-1/+1
| | | | | | | | | | | | | | | | * m4/isfinite.m4 (gl_ISFINITEL_WORKS): Add missing parenthesis in LDBL80_WORDS macro. * m4/isinf.m4 (gl_ISINFL_WORKS): Likewise. * m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): Likewise. * tests/test-isfinite.c (test_isfinitel): Likewise. * tests/test-isinf.c (test_isinfl): Likewise. * tests/test-isnan.c (test_long_double): Likewise. * tests/test-isnanl.h (main): Likewise. * tests/test-snprintf-posix.h (LDBL80_WORDS): Add missing parenthesis. * tests/test-sprintf-posix.h (LDBL80_WORDS): Likewise. * tests/test-vasnprintf-posix.c (LDBL80_WORDS): Likewise. * tests/test-vasprintf-posix.c (LDBL80_WORDS): Likewise. Reported by Pádraig Brady.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* Write "Mac OS X" instead of "MacOS X".Bruno Haible2012-06-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * README: Write "Mac OS X" instead of "MacOS X". * build-aux/bootstrap: Likewise. * build-aux/install-reloc: Likewise. * lib/acl-internal.h: Likewise. * lib/acl_entries.c: Likewise. * lib/argp-ba.c: Likewise. * lib/argp-pv.c: Likewise. * lib/config.charset: Likewise. * lib/copy-acl.c: Likewise. * lib/csharpexec.c: Likewise. * lib/euidaccess.c: Likewise. * lib/fbufmode.c: Likewise. * lib/fflush.c: Likewise. * lib/file-has-acl.c: Likewise. * lib/filemode.h: Likewise. * lib/fpurge.c: Likewise. * lib/freadable.c: Likewise. * lib/freadahead.c: Likewise. * lib/freading.c: Likewise. * lib/freadptr.c: Likewise. * lib/freadseek.c: Likewise. * lib/fseeko.c: Likewise. * lib/fseterr.c: Likewise. * lib/fsusage.c: Likewise. * lib/fwritable.c: Likewise. * lib/fwriting.c: Likewise. * lib/get-rusage-as.c: Likewise. * lib/get-rusage-data.c: Likewise. * lib/getdomainname.c: Likewise. * lib/idpriv-drop.c: Likewise. * lib/idpriv-droptemp.c: Likewise. * lib/localcharset.c: Likewise. * lib/locale.in.h: Likewise. * lib/localename.c: Likewise. * lib/mbsrtowcs-state.c: Likewise. * lib/nproc.c: Likewise. * lib/passfd.c: Likewise. * lib/posix_openpt.c: Likewise. * lib/printf-parse.c: Likewise. * lib/progreloc.c: Likewise. * lib/safe-read.h: Likewise. * lib/safe-write.h: Likewise. * lib/sched.in.h: Likewise. * lib/set-mode-acl.c: Likewise. * lib/signal.in.h: Likewise. * lib/stdint.in.h: Likewise. * lib/stdio-impl.h: Likewise. * lib/stdlib.in.h: Likewise. * lib/strtod.c: Likewise. * lib/sys_select.in.h: Likewise. * lib/tcgetsid.c: Likewise. * lib/unistd.in.h: Likewise. * lib/unlockpt.c: Likewise. * lib/vasnprintf.c: Likewise. * lib/vma-iter.c: Likewise. * lib/wcsrtombs-state.c: Likewise. * m4/acl.m4: Likewise. * m4/acosl.m4: Likewise. * m4/asinl.m4: Likewise. * m4/atanl.m4: Likewise. * m4/c-stack.m4: Likewise. * m4/cosl.m4: Likewise. * m4/expl.m4: Likewise. * m4/extensions.m4: Likewise. * m4/fdatasync.m4: Likewise. * m4/fmal.m4: Likewise. * m4/frexp.m4: Likewise. * m4/frexpf.m4: Likewise. * m4/frexpl.m4: Likewise. * m4/fsusage.m4: Likewise. * m4/getdomainname.m4: Likewise. * m4/getloadavg.m4: Likewise. * m4/getopt.m4: Likewise. * m4/gettext.m4: Likewise. * m4/gnulib-common.m4: Likewise. * m4/intdiv0.m4: Likewise. * m4/intlmacosx.m4: Likewise. * m4/largefile.m4: Likewise. * m4/ldexpl.m4: Likewise. * m4/link-follow.m4: Likewise. * m4/locale-ar.m4: Likewise. * m4/locale-fr.m4: Likewise. * m4/locale-ja.m4: Likewise. * m4/locale-tr.m4: Likewise. * m4/locale-zh.m4: Likewise. * m4/locale_h.m4: Likewise. * m4/lock.m4: Likewise. * m4/logl.m4: Likewise. * m4/mathfunc.m4: Likewise. * m4/minus-zero.m4: Likewise. * m4/mktime.m4: Likewise. * m4/mmap-anon.m4: Likewise. * m4/multiarch.m4: Likewise. * m4/nanosleep.m4: Likewise. * m4/nocrash.m4: Likewise. * m4/poll.m4: Likewise. * m4/printf-frexpl.m4: Likewise. * m4/printf.m4: Likewise. * m4/signbit.m4: Likewise. * m4/sinl.m4: Likewise. * m4/sqrtl.m4: Likewise. * m4/strerror_r.m4: Likewise. * m4/tanl.m4: Likewise. * m4/threadlib.m4: Likewise. * m4/ttyname_r.m4: Likewise. * m4/unlink.m4: Likewise. * m4/visibility.m4: Likewise. * m4/wcwidth.m4: Likewise. * tests/minus-zero.h: Likewise. * tests/test-alloca-opt.c: Likewise. * tests/test-copy-acl.sh: Likewise. * tests/test-copy-file.sh: Likewise. * tests/test-fdatasync.c: Likewise. * tests/test-file-has-acl.sh: Likewise. * tests/test-flock.c: Likewise. * tests/test-fsync.c: Likewise. * tests/test-localename.c: Likewise. * tests/test-malloca.c: Likewise. * tests/test-nonblocking-pipe.h: Likewise. * tests/test-nonblocking-socket.h: Likewise. * tests/test-openpty.c: Likewise. * tests/test-posix_openpt.c: Likewise. * tests/test-ptsname.c: Likewise. * tests/test-ptsname_r.c: Likewise. * tests/test-sameacls.c: Likewise. * tests/test-select.h: Likewise. * tests/test-set-mode-acl.sh: Likewise. * tests/test-snprintf-posix.h: Likewise. * tests/test-sprintf-posix.h: Likewise. * tests/test-strtod.c: Likewise. * tests/test-time.c: Likewise. * tests/test-vasnprintf-posix.c: Likewise. * tests/test-vasprintf-posix.c: Likewise. * doc/acl-resources.txt: Likewise. * doc/**/*.texi: Likewise. Reported by Max Horn <max@quendi.de>.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* *printf-posix tests: Fix for platforms where 'long double' == 'double'.Bruno Haible2011-10-091-4/+4
| | | | | | | | | | | | | | | * modules/snprintf-posix-tests (configure.ac): Require gl_LONG_DOUBLE_VS_DOUBLE. * modules/sprintf-posix-tests (configure.ac): Likewise. * modules/vasnprintf-posix-tests (configure.ac): Likewise. * modules/vasprintf-posix-tests (configure.ac): Likewise. * modules/vsnprintf-posix-tests (configure.ac): Likewise. * modules/vsprintf-posix-tests (configure.ac): Likewise. * tests/test-snprintf-posix.h (test_function): Avoid 80-bit long double tests on platforms where 'long double' is the same as 'double'. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnprintf-posix.c (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise.
* Support for MSVC compiler: Avoid division by a literal 0.Bruno Haible2011-09-111-30/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/math.in.h (NAN): Define through a function call also on MSVC. * m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Divide by 'zero' instead of 0.0. * m4/printf.m4 (gl_PRINTF_INFINITE, gl_PRINTF_DIRECTIVE_A, gl_PRINTF_DIRECTIVE_F, gl_PRINTF_FLAG_ZERO): Likewise. (gl_PRINTF_INFINITE_LONG_DOUBLE): Divide by 'zeroL' instead of 0.0L. * tests/infinity.h: New file. * tests/nan.h (NaNf, NaNd, NaNl): Define through a function call also on MSVC. * tests/test-ceilf1.c: Include infinity.h. (main): Use Infinityf. * tests/test-ceil1.c: Include infinity.h. (main): Use Infinityd. * tests/test-ceill.c: Include infinity.h. (main): Use Infinityl. * tests/test-dprintf-posix.c: Include infinity.h. (test_function): Use Infinityd. * tests/test-floorf1.c: Include infinity.h. (main): Use Infinityf. * tests/test-floor1.c: Include infinity.h. (main): Use Infinityd. * tests/test-floorl.c: Include infinity.h. (main): Use Infinityl. * tests/test-fprintf-posix.c: Include infinity.h. (test_function): Use Infinityd. * tests/test-frexp.c: Include infinity.h. (main): Use Infinityd. * tests/test-frexpl.c: Include infinity.h. (main): Use Infinityl. * tests/test-isfinite.c: Include infinity.h. (test_isfinitef): Use Infinityf. (test_isfinited): Use Infinityd. (test_isfinitel): Use Infinityl. * tests/test-isinf.c: Include infinity.h. (test_isinff): Use Infinityf. (test_isinfd): Use Infinityd. (test_isinfl): Use Infinityl. * tests/test-isnan.c: Include infinity.h. (test_float): Use Infinityf. (test_double): Use Infinityd. (test_long_double): Use Infinityl. * tests/test-isnanf.h: Include infinity.h. (main): Use Infinityf. * tests/test-isnand.h: Include infinity.h. (main): Use Infinityd. * tests/test-isnanl.h: Include infinity.h. (main): Use Infinityl. * tests/test-ldexpl.c: Include infinity.h. (main): Use Infinityl. * tests/test-printf-posix.h: Include infinity.h. (test_function): Use Infinityd. * tests/test-roundf1.c: Include infinity.h. (main): Use Infinityf. * tests/test-round1.c: Include infinity.h. (main): Use Infinityd. * tests/test-roundl.c: Include infinity.h. (main): Use Infinityl. * tests/test-signbit.c: Include infinity.h. (test_signbitf): Use Infinityf. (test_signbitd): Use Infinityd. (test_signbitl): Use Infinityl. * tests/test-snprintf-posix.h: Include infinity.h. (test_function): Use Infinityd, Infinityl. * tests/test-sprintf-posix.h: Include infinity.h. (test_function): Use Infinityd, Infinityl. * tests/test-truncf1.c: Include infinity.h. (main): Use Infinityf. * tests/test-trunc1.c: Include infinity.h. (main): Use Infinityd. * tests/test-truncl.c: Include infinity.h. (main): Use Infinityl. * tests/test-vasnprintf-posix.c: Include infinity.h. (test_function): Use Infinityd, Infinityl. * tests/test-vasprintf-posix.c: Include infinity.h. (test_function): Use Infinityd, Infinityl. * modules/ceilf-tests (Files): Add tests/infinity.h. * modules/ceil-tests (Files): Likewise. * modules/ceill-tests (Files): Likewise. * modules/dprintf-posix-tests (Files): Likewise. * modules/floorf-tests (Files): Likewise. * modules/floor-tests (Files): Likewise. * modules/floorl-tests (Files): Likewise. * modules/fprintf-posix-tests (Files): Likewise. * modules/frexp-tests (Files): Likewise. * modules/frexp-nolibm-tests (Files): Likewise. * modules/frexpl-tests (Files): Likewise. * modules/frexpl-nolibm-tests (Files): Likewise. * modules/isfinite-tests (Files): Likewise. * modules/isinf-tests (Files): Likewise. * modules/isnan-tests (Files): Likewise. * modules/isnanf-tests (Files): Likewise. * modules/isnanf-nolibm-tests (Files): Likewise. * modules/isnand-tests (Files): Likewise. * modules/isnand-nolibm-tests (Files): Likewise. * modules/isnanl-tests (Files): Likewise. * modules/isnanl-nolibm-tests (Files): Likewise. * modules/ldexpl-tests (Files): Likewise. * modules/printf-posix-tests (Files): Likewise. * modules/roundf-tests (Files): Likewise. * modules/round-tests (Files): Likewise. * modules/roundl-tests (Files): Likewise. * modules/signbit-tests (Files): Likewise. * modules/snprintf-posix-tests (Files): Likewise. * modules/sprintf-posix-tests (Files): Likewise. * modules/truncf-tests (Files): Likewise. * modules/trunc-tests (Files): Likewise. * modules/truncl-tests (Files): Likewise. * modules/vasnprintf-posix-tests (Files): Likewise. * modules/vasprintf-posix-tests (Files): Likewise. * modules/vdprintf-posix-tests (Files): Likewise. * modules/vfprintf-posix-tests (Files): Likewise. * modules/vprintf-posix-tests (Files): Likewise. * modules/vsnprintf-posix-tests (Files): Likewise. * modules/vsprintf-posix-tests (Files): Likewise. * modules/xprintf-posix-tests (Files): Likewise.
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* *printf: Detect large precisions bug on Solaris 10/SPARC.Bruno Haible2010-12-241-0/+13
| | | | | | | | | | | | | | | | | | | | | * m4/printf.m4 (gl_PRINTF_PRECISION): Add one more test code, provided by Paul Eggert. * tests/test-snprintf-posix.h (test_function): Add this test code here too. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnprintf-posix.c (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise. * doc/posix-functions/fprintf.texi: Mention Solaris 10 bug as worked around by gnulib. * doc/posix-functions/printf.texi: Likewise. * doc/posix-functions/snprintf.texi: Likewise. * doc/posix-functions/sprintf.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/posix-functions/dprintf.texi: Undo last commit. * doc/posix-functions/vdprintf.texi: Likewise.
* *printf-posix: Detect a bug on Solaris 10/x86.Bruno Haible2010-11-281-0/+13
| | | | | | | | | | | | | | | | | | | | * m4/printf.m4 (gl_PRINTF_PRECISION): Detect crash with large precision for floating-point output. * tests/test-vasnprintf-posix.c (test_function): Test precision with %f directive. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise. * doc/posix-functions/fprintf.texi: Mention Solaris/x86 bug. * doc/posix-functions/printf.texi: Likewise. * doc/posix-functions/snprintf.texi: Likewise. * doc/posix-functions/sprintf.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/obstack_printf.texi: Likewise. * doc/glibc-functions/obstack_vprintf.texi: Likewise.
* frexp, tests: work around ICC bug with -zeroEric Blake2010-11-041-26/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Compute -0.0 in a way that works with more compilers. * tests/minus-zero.h: New file. * modules/ceilf-tests (Files): Include it. * modules/ceill-tests (Files): Likewise. * modules/floorf-tests (Files): Likewise. * modules/floorl-tests (Files): Likewise. * modules/frexp-nolibm-tests (Files): Likewise. * modules/frexp-tests (Files): Likewise. * modules/frexpl-nolibm-tests (Files): Likewise. * modules/frexpl-tests (Files): Likewise. * modules/isnan-tests (Files): Likewise. * modules/isnand-nolibm-tests (Files): Likewise. * modules/isnand-tests (Files): Likewise. * modules/isnanf-nolibm-tests (Files): Likewise. * modules/isnanf-tests (Files): Likewise. * modules/isnanl-nolibm-tests (Files): Likewise. * modules/isnanl-tests (Files): Likewise. * modules/round-tests (Files): Likewise. * modules/roundf-tests (Files): Likewise. * modules/roundl-tests (Files): Likewise. * modules/ldexpl-tests (Files): Likewise. * modules/signbit-tests (Files): Likewise. * modules/snprintf-posix-tests (Files): Likewise. * modules/sprintf-posix-tests (Files): Likewise. * modules/strtod-tests (Files): Likewise. * modules/trunc-tests (Files): Likewise. * modules/truncf-tests (Files): Likewise. * modules/truncl-tests (Files): Likewise. * modules/vsnprintf-posix-tests (Files): Likewise. * modules/vsprintf-posix-tests (Files): Likewise. * modules/vasnprintf-posix-tests (Files): Likewise. * modules/vasprintf-posix-tests (Files): Likewise. * tests/test-ceilf1.c (main): Use it. * tests/test-ceill.c (main): Likewise. * tests/test-floorf1.c (main): Likewise. * tests/test-floorl.c (main): Likewise. * tests/test-frexp.c (main): Likewise. * tests/test-frexpl.c (main): Likewise. * tests/test-isnan.c (main): Likewise. * tests/test-isnand.h (main): Likewise. * tests/test-isnanf.h (main): Likewise. * tests/test-isnanl.h (main): Likewise. * tests/test-ldexpl.c (main): Likewise. * tests/test-round.c (main): Likewise. * tests/test-roundf.c (main): Likewise. * tests/test-roundl.c (main): Likewise. * tests/test-signbit.c (test_signbitf, test_signbitd) (test_signbitl): Likewise. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-strtod.c (main): Likewise. * tests/test-trunc1.c (main): Likewise. * tests/test-truncf1.c (main): Likewise. * tests/test-truncl.c (main): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-802/+802
|
* vasnprintf: Fix invalid read past end of memory block.Bruno Haible2009-02-241-0/+46
|
* tests: IRIX 6.2 cc can't compile -0.0 into .dataEric Blake2009-01-121-2/+8
| | | | | | | | | | | | | | | | | | | | * tests/test-ceill.c (minus_zero): Compute -0.0L at runtime, rather than at compile-time. * tests/test-floorl.c (minus_zero): Likewise. * tests/test-frexpl.c (minus_zero): Likewise. * tests/test-isnan.c (minus_zerol): Likewise. * tests/test-isnanl.h (minus_zero): Likewise. * tests/test-ldexpl.c (minus_zero): Likewise. * tests/test-roundl.c (minus_zero): Likewise. * tests/test-signbit.c (minus_zerol): Likewise. * tests/test-snprintf-posix.h (minus_zerol): Likewise. * tests/test-sprintf-posix.h (minus_zerol): Likewise. * tests/test-truncl.c (minus_zero): Likewise. * tests/test-vasnprintf-posix.c (minus_zerol): Likewise. * tests/test-vasprintf-posix.c (minus_zerol): Likewise. Reported by Tom G. Christensen and Nelson H. F. Beebe. Signed-off-by: Eric Blake <ebb9@byu.net>
* Avoid compilation error due to MacOS X 10.5 gcc cross-compilation bug.Bruno Haible2008-10-181-1/+7
|
* Use a more portable replacement expression for -0.0L.Bruno Haible2008-10-081-9/+9
|
* Allow 3-digit exponents in %e and %g results on 'long double'.Bruno Haible2008-09-211-21/+57
|
* Remove useless ASSERTs.Bruno Haible2008-09-211-9/+0
|
* vasnprintf-posix: handle large precision via %.*dEric Blake2008-09-021-0/+12
| | | | | | | | | | | | * lib/vasnprintf.c (VASNPRINTF): Don't pass precision to snprintf when handling it ourselves. * tests/test-vasnprintf-posix.c (test_function): Add test. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise. Reported by Alain Guibert. Signed-off-by: Eric Blake <ebb9@byu.net>
* Work around bug of HP-UX 10.20 cc with -0.0 literal.Bruno Haible2008-08-011-11/+19
|
* Fix rounding when a precision is given.Bruno Haible2008-04-191-0/+130
|
* Use macros NaNf, NaNd, NaNl instead of NAN.Bruno Haible2008-04-021-26/+19
|
* Guarantee a definition of NAN.Eric Blake2008-03-311-20/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/math.in.h (NAN): Define if missing. * tests/test-math.c (main): Test it. * doc/posix-headers/math.texi (math.h): Document this. * lib/isnan.c (rpl_isnand): Use it. * tests/test-ceilf1.c (NaN): Delete, and use NAN instead. * tests/test-floorf1.c (NaN): Likewise. * tests/test-frexp.c (NaN): Likewise. * tests/test-isnand.c (NaN): Likewise. * tests/test-isnanf.c (NaN): Likewise. * tests/test-round1.c (NaN): Likewise. * tests/test-roundf1.c (NaN): Likewise. * tests/test-snprintf-posix.h (NaN): Likewise. * tests/test-sprintf-posix.h (NaN): Likewise. * tests/test-trunc1.c (NaN): Likewise. * tests/test-truncf1.c (NaN): Likewise. * tests/test-vasnprintf-posix.c (NaN): Likewise. * tests/test-vasprintf-posix.c (NaN): Likewise. * modules/isnand-nolibm (Depends-on): Add math. * modules/isnanf-nolibm (Depends-on): Likewise. * modules/isnanl (Depends-on): Likewise. * modules/isnanl-nolibm (Depends-on): Likewise. * modules/snprintf-posix-tests (Depends-on): Likewise. * modules/sprintf-posix-tests (Depends-on): Likewise. * modules/vsnprintf-posix-tests (Depends-on): Likewise. * modules/vsprintf-posix-tests (Depends-on): Likewise. * modules/vasnprintf-posix-tests (Depends-on): Likewise. * modules/vasprintf-posix-tests (Depends-on): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* Fix *printf behaviour regarding the left-adjust flag on HP-UX 10.20.Bruno Haible2008-02-071-1/+27
|
* Add tests for large precisions.Bruno Haible2007-11-041-0/+93
|
* Change copyright notice from GPLv2+ to GPLv3+.Bruno Haible2007-10-071-5/+4
|
* Fix *printf so that it recognizes non-IEEE numbers on i386, x86_64, ia64.Bruno Haible2007-06-061-1/+362
|