lkml.org 
[lkml]   [2007]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC] [3/9] modpost: Declare the modpost error functions as printf like
On Thu, Nov 22, 2007 at 03:43:08AM +0100, Andi Kleen wrote:
>
> This way gcc can warn for wrong format strings

This loks good. Can I get i s-o-b then I will apply it.

Sam


>
> ---
> scripts/mod/modpost.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> Index: linux/scripts/mod/modpost.c
> ===================================================================
> --- linux.orig/scripts/mod/modpost.c
> +++ linux/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;
>


\
 
 \ /
  Last update: 2007-12-10 19:51    [W:0.192 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site