summaryrefslogtreecommitdiff
path: root/m4/snprintf.m4
Commit message (Collapse)AuthorAgeFilesLines
* 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'.
* Avoid redefinition errors on MSVC.Bruno Haible2016-12-171-1/+9
| | | | | | | * m4/snprintf.m4 (gl_REPLACE_SNPRINTF): Set REPLACE_SNPRINTF to 1 if the function may be defined as an inline function. * m4/vsnprintf.m4 (gl_REPLACE_VSNPRINTF): Set REPLACE_VSNPRINTF to 1 if the function may be defined as an inline function.
* 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'.
* 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'.
* 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>
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* snprintf: guarantee %1$d, for libintlEric Blake2011-07-051-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Newer mingw (but not yet mingw64) provides two flavors of snprintf: _snprintf defers straight to msvcrt, which has broken return value and does not understand %llu or %zu; and snprintf, which fixes these two bugs but does not understand %1$s. Libintl specifically favors _snprintf, with broken return value, even when compiled on mingw with a fixed snprintf, because the only behavior which it wants to fix is %1$s handling. But this means that the replacement libintl_snprintf has a broken return. If one uses the 'snprintf-posix' module, then the gnulib replacement kicks in, and does everything that libintl needs, so on mingw, <libintl.h> specifically avoids overriding snprintf if it detected that gnulib replaced snprintf. However, if one only uses the 'snprintf' module and also uses libintl, this means there are two problems: 1. The gnulib 'snprintf' module does not replace the mingw snprintf function, because it has proper return values, while the libintl.h header knows that %1$d is broken so snprintf must be replaced, with the end result that the application gets the libintl replacement snprintf with broken return values in spite of the gnulib module. 2. Conversely, if the application did '#define snprintf snprintf', that would be enough to make libintl avoid installing its own replacement because libintl would see the define as a sign that gnulib is happy with snprintf. However, if gnulib didn't enforce %1$s, users can end up with translated strings that break when passed to the native snprintf. Happily, the gnulib snprintf replacement already guarantees %1$s without needing any further preprocessor macros defined, and without dragging in the LGPLv3+ bulk of snprintf-posix, so the problem boils down to guaranteeing that gnulib will replace snprintf if it lacks %1$s support. Basically, gnulib must replace snprintf under all the same conditions as libintl, as well as any other conditions of its own, if the libintl trick of deferring to gnulib is to work correctly. * m4/snprintf.m4 (gl_FUNC_SNPRINTF): Require %1$d support. * m4/vsnprintf.m4 (gl_FUNC_VSNPRINTF): Likewise. * doc/posix-functions/snprintf.texi (snprintf): Update. * doc/posix-functions/vsnprintf.texi (vsnprintf): Likewise. * tests/test-snprintf.c (main): Enhance test. * tests/test-vsnprintf.c (main): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* snprintf: port snprintf (NULL, 0, ...) to Solaris 8 and 9Paul Eggert2010-12-211-1/+6
| | | | | | | | | | | | | | | | | | This fixes a problem observed with the latest coreutils snapshot that caused a test to fail on Solaris 8. src/csplit.c's call snprintf (NULL, 0, format, UINT_MAX) returns -1 on Solaris 9 and earlier, instead of returning the number of bytes that would have been generated; this causes csplit to incorrectly report memory exhaustion. * m4/printf.m4 (gl_SNPRINTF_RETVAL_C99): Also check for snprintf (NULL, 0, ...) and (for good measure) snprintf (buf, 0, ...). Guess that it doesn't work on Solaris 2.6 through 9. Adjust comments to match. (gl_PRINTF_SIZES_C99, gl_PRINTF_DIRECTIVE_F, gl_SNPRINTF_RETVAL_C99): Fix typo in matching older versions of Solaris: "solaris2.10" is matched by the shell pattern "solaris2.[0-9]*". This matters only for guessing while cross-compiling. * m4/snprintf.m4 (gl_FUNC_SNPRINTF): Also check gl_SNPRINTF_RETVAL_C99.
* 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
* update nearly all FSF copyright year lists to include 2009Jim Meyering2009-12-291-1/+1
| | | | | | | | | | | | | | | | | | The files named by the following are exempted: grep -v '^#' config/srclist.txt|grep -v '^$' \ | while read src dst; do test -f "$dst" && { echo "$dst"; continue; } test -d "$dst" || continue echo "$dst"/$(basename "$src") done > exempt git ls-files tests/unictype >> exempt In the remaining files, convert to all-interval notation if - there is already at least one year interval like 2000-2003 - the file is maintained by me - the file is in lib/uni*/, where that style already prevails Otherwise, use update-copyright's default.
* Work around snprintf bug on Linux libc5.Bruno Haible2008-04-191-3/+12
|
* Fix last commit: Require gl_STDIO_H_DEFAULTS.Bruno Haible2007-03-071-0/+1
|
* New module 'snprintf-posix'.Bruno Haible2007-03-071-3/+14
|
* snprintf.h is replaced with <stdio.h>.Bruno Haible2007-02-211-2/+6
|
* Use an all-permissive copyright notice, recommended by RMS.Paul Eggert2005-01-231-6/+4
|
* Fix typo in comment.Bruno Haible2004-10-011-1/+1
|
* New snprintf module from Simon Josefsson.Paul Eggert2004-09-301-0/+17