[CRIU] [PATCH 1/8] Annotate printk with printf attribute

Kir Kolyshkin kir at openvz.org
Tue Jan 31 06:31:21 EST 2012


This way gcc will be able to catch invalid format bugs.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 include/util.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/util.h b/include/util.h
index b44165e..cc53ead 100644
--- a/include/util.h
+++ b/include/util.h
@@ -16,7 +16,8 @@
 #include "compiler.h"
 #include "types.h"
 
-extern void printk(const char *format, ...);
+extern void printk(const char *format, ...)
+	__attribute__ ((__format__ (__printf__, 1, 2)));
 
 #define PREF_SHIFT_OP(pref, op, size)	((size) op (pref ##BYTES_SHIFT))
 #define KBYTES_SHIFT	10
-- 
1.7.4.4



More information about the CRIU mailing list