http-backend: Let gcc check the format of more printf-type functions.
We already have these checks in many printf-type functions that have prototypes which are in header files. Add these same checks to static functions in http-backend.c Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tarmigan Casebolt committed
Nov 14, 2009 at 13:10 UTC
354870171bc98dfef7dfa037b3fe9ac9454c94a2
1 file changed
+3
http-backend.c
+3
@@ -108,6 +108,7 @@ static const char *get_parameter(const char *name)
108
return i ? i->util : NULL;
109
}
110
111
+__attribute__((format (printf, 2, 3)))
112
static void format_write(int fd, const char *fmt, ...)
113
{
114
static char buffer[1024];
@@ -165,6 +166,7 @@ static void end_headers(void)
166
safe_write(1, "\r\n", 2);
167
}
168
169
+__attribute__((format (printf, 1, 2)))
170
static NORETURN void not_found(const char *err, ...)
171
{
172
va_list params;
@@ -180,6 +182,7 @@ static NORETURN void not_found(const char *err, ...)
182
exit(0);
183
}
184
185
+__attribute__((format (printf, 1, 2)))
186
static NORETURN void forbidden(const char *err, ...)
187
{
188
va_list params;