diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2011-03-16 00:15:31 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-17 15:30:49 -0700 |
commit | 28bd70d811391be10c55ce4aee1b6ee991d7a86b (patch) | |
tree | bf682c250e811b0e8f52e9305b5b4b23dc521bd5 /configure.ac | |
parent | 31d713d069f6586c3b18aa721ccd668fa994219c (diff) | |
download | git-28bd70d811391be10c55ce4aee1b6ee991d7a86b.tar.gz |
unbreak and eliminate NO_C99_FORMAT
In the spirit of v1.5.0.2~21 (Check for PRIuMAX rather than
NO_C99_FORMAT in fast-import.c, 2007-02-20), use PRIuMAX from
git-compat-util.h on all platforms instead of C99-specific formats
like %zu with dangerous fallbacks to %u or %lu.
So now C99-challenged platforms can build git without provoking
warnings or errors from printf, even if pointers do not have the same
size as an int or long.
The need for a fallback PRIuMAX is detected in git-compat-util.h with
"#ifndef PRIuMAX". So while at it, simplify the Makefile and configure
script by eliminating the NO_C99_FORMAT knob altogether.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac index 20039c546f..dd0790725b 100644 --- a/configure.ac +++ b/configure.ac @@ -686,30 +686,6 @@ AC_CHECK_TYPE([struct addrinfo],[ ]) AC_SUBST(NO_IPV6) # -# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) -# do not support the 'size specifiers' introduced by C99, namely ll, hh, -# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). -# some C compilers supported these specifiers prior to C99 as an extension. -AC_CACHE_CHECK([whether formatted IO functions support C99 size specifiers], - [ac_cv_c_c99_format], -[# Actually git uses only %z (%zu) in alloc.c, and %t (%td) in mktag.c -AC_RUN_IFELSE( - [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], - [[char buf[64]; - if (sprintf(buf, "%lld%hhd%jd%zd%td", (long long int)1, (char)2, (intmax_t)3, (size_t)4, (ptrdiff_t)5) != 5) - return 1; - else if (strcmp(buf, "12345")) - return 2;]])], - [ac_cv_c_c99_format=yes], - [ac_cv_c_c99_format=no]) -]) -if test $ac_cv_c_c99_format = no; then - NO_C99_FORMAT=YesPlease -else - NO_C99_FORMAT= -fi -AC_SUBST(NO_C99_FORMAT) -# # Define NO_REGEX if you have no or inferior regex support in your C library. AC_CACHE_CHECK([whether the platform regex can handle null bytes], [ac_cv_c_excellent_regex], [ |