path: root/
diff options
authorJonathan Nieder <>2011-03-16 05:15:31 (GMT)
committerJunio C Hamano <>2011-03-17 22:30:49 (GMT)
commit28bd70d811391be10c55ce4aee1b6ee991d7a86b (patch)
treebf682c250e811b0e8f52e9305b5b4b23dc521bd5 /
parent31d713d069f6586c3b18aa721ccd668fa994219c (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to '')
1 files changed, 0 insertions, 24 deletions
diff --git a/ b/
index 20039c5..dd07907 100644
--- a/
+++ b/
@@ -686,30 +686,6 @@ AC_CHECK_TYPE([struct addrinfo],[
-# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf
-# 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
- [[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
# 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], [