Skip to content

Commit 6d9a89e

Browse files
Andi Kleensravnborg
authored andcommitted
kbuild: declare the modpost error functions as printf like
This way gcc can warn for wrong format strings Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]>
1 parent 6e588f6 commit 6d9a89e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/mod/modpost.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ enum export {
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, ...)
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, ...)
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

0 commit comments

Comments
 (0)