[CRIU] [crtools-bot] Annotate printk with printf attribute

Cyrill Gorcunov gorcunov at openvz.org
Tue Jan 31 06:56:33 EST 2012


The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit fa5ce3112f096dde57222759cb490e3920a0ff36
Author: Kir Kolyshkin <kir at openvz.org>
Date:   Tue Jan 31 15:31:21 2012 +0400

    Annotate printk with printf attribute
    
    This way gcc will be able to catch invalid format bugs.
    
    Signed-off-by: Kir Kolyshkin <kir at openvz.org>
    Signed-off-by: Cyrill Gorcunov <gorcunov 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 05a6572..e9c1832 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


More information about the CRIU mailing list