|author||Mark Lodato <email@example.com>||2010-09-04 11:30:18 -0400|
|committer||Mark Lodato <firstname.lastname@example.org>||2010-09-04 11:35:38 -0400|
|parent||use __attribute__ to catch printf format mistakes (diff)|
fix errors in printf-style format strings
There were many places where the arguments to a printf-like function did not match the format string. Mostly, these were a missing 'l' flag, but there were three exceptions: - In ui-stats.c, a size_t argument must be printed. C99 has the "%zu" flag for this purpose, but not all compilers support this. Therefore, we mimic what git does - use a NO_C99_FORMAT Makefile variable. - In ui-stats.c, cgit_print_error() was called with a pointer instead of a character. - In ui-log.c, the "columns" argument was never used. Signed-off-by: Mark Lodato <email@example.com>
Diffstat (limited to 'Makefile')
1 files changed, 8 insertions, 0 deletions
@@ -16,6 +16,11 @@ INSTALL = install
# Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin).
+# 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.
@@ -127,6 +132,9 @@ endif
CFLAGS += -DNO_STRCASESTR
+ CFLAGS += -DNO_C99_FORMAT
CFLAGS += -DNO_OPENSSL
GIT_OPTIONS += NO_OPENSSL=1