Skip to content

Commit

Permalink
kbuild: declare the modpost error functions as printf like
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andi Kleen authored and Sam Ravnborg committed Jan 28, 2008
1 parent 6e588f6 commit 6d9a89e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit 6d9a89e

Please sign in to comment.