From: Andi Kleen Date: Thu, 22 Nov 2007 02:43:08 +0000 (+0100) Subject: kbuild: declare the modpost error functions as printf like X-Git-Tag: v2.6.25-rc1~1164^2~66 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=6d9a89ea4b06146d29e1ffb4d6fded286fa07d29;p=linux-2.6-omap-h63xx.git kbuild: declare the modpost error functions as printf like This way gcc can warn for wrong format strings Signed-off-by: Andi Kleen Signed-off-by: Sam Ravnborg --- diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 93ac52adb49..3a12c22cc2f 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -33,7 +33,9 @@ enum export { export_unused_gpl, export_gpl_future, export_unknown }; -void fatal(const char *fmt, ...) +#define PRINTF __attribute__ ((format (printf, 1, 2))) + +PRINTF void fatal(const char *fmt, ...) { va_list arglist; @@ -46,7 +48,7 @@ void fatal(const char *fmt, ...) exit(1); } -void warn(const char *fmt, ...) +PRINTF void warn(const char *fmt, ...) { va_list arglist; @@ -57,7 +59,7 @@ void warn(const char *fmt, ...) va_end(arglist); } -void merror(const char *fmt, ...) +PRINTF void merror(const char *fmt, ...) { va_list arglist;