[PATCH 1/2] Check format string of die()

Aleksey Makarov aleksey.makarov at gmail.com
Tue Jun 26 13:53:42 EDT 2012


Use gcc's __attribute__ to check format string.

Signed-off-by: Aleksey Makarov <aleksey.makarov at gmail.com>
---
 kexec/kexec.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kexec/kexec.h b/kexec/kexec.h
index 279dfdf..d24b3fa 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -215,7 +215,8 @@ extern int file_types;
 
 #define KEXEC_OPT_STR "hvdfxluet:p"
 
-extern void die(char *fmt, ...);
+extern void die(char *fmt, ...)
+	__attribute__ ((format (printf, 1, 2)));
 extern void *xmalloc(size_t size);
 extern void *xrealloc(void *ptr, size_t size);
 extern char *slurp_file(const char *filename, off_t *r_size);
-- 
1.7.7.6




More information about the kexec mailing list