repair: check repair message printflike arguments
PATCH 1/1 repair: check repair message printflike arguments
Unfortunately this lights up warnings like a christmas tree, but it does catch a few gems like:
scan.c:567: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘const char *’
passing a string to a %d :(
Signed-off-by Eric Sandeen <[email protected]>
---
repair/err_protos.h +6 -4
@@ -17,10 +17,12 @@*/ /* abort, internal error */ -void __attribute__((noreturn))do_abort (char const *, ...); +void do_abort (char const *, ...) + __attribute__((format (printf,1 ,2 ))) __attribute__((noreturn));/* abort, system error */ -void __attribute__((noreturn))do_error (char const *, ...); +void do_error (char const *, ...) __attribute__((noreturn)); + __attribute__((format (printf, 1, 2))) __attribute__((noreturn));/* issue warning */ -void do_warn (char const *, ...); +void do_warn (char const *, ...) __attribute__ ((format (printf,1 ,2 )));/* issue log message */ -void do_log (char const *, ...); +void do_log (char const *, ...) __attribute__ ((format (printf,1 ,2 )));
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs