History

kbuild: declare the modpost error functions as printf like

This way gcc can warn for wrong format strings Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

Andi Kleen committed 18 years ago

Commit 6d9a89e1 parent 6e588f61 file · +5 −3Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/mod/modpost.c+5−3
@@ -33,7 +33,9 @@ enum export { · 32 unmodified lines
3333 export_unused_gpl, export_gpl_future, export_unknown
3434 };
3535
36−void fatal(const char *fmt, ...)
36+#define PRINTF __attribute__ ((format (printf, 1, 2)))
37+
38+PRINTF void fatal(const char *fmt, ...)
3739 {
3840 va_list arglist;
3941
@@ -46,7 +48,7 @@ void fatal(const char *fmt, ...) · 6 unmodified lines
4648 exit(1);
4749 }
4850
49−void warn(const char *fmt, ...)
51+PRINTF void warn(const char *fmt, ...)
5052 {
5153 va_list arglist;
5254
@@ -57,7 +59,7 @@ void warn(const char *fmt, ...) · 4 unmodified lines
5759 va_end(arglist);
5860 }
5961
60−void merror(const char *fmt, ...)
62+PRINTF void merror(const char *fmt, ...)
6163 {
6264 va_list arglist;
6365