public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] repair: check repair message printflike arguments
@ 2010-03-16 22:37 Eric Sandeen
  0 siblings, 0 replies; only message in thread
From: Eric Sandeen @ 2010-03-16 22:37 UTC (permalink / raw)
  To: xfs-oss

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 <sandeen@sandeen.net>
---

diff --git a/repair/err_protos.h b/repair/err_protos.h
index 6944950..2e3bf97 100644
--- a/repair/err_protos.h
+++ b/repair/err_protos.h
@@ -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
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-16 22:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-16 22:37 [PATCH] repair: check repair message printflike arguments Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox