[CRIU] [PATCH] do_open_proc: annotate with printf attr

Kir Kolyshkin kir at openvz.org
Mon Feb 13 14:52:32 PST 2017


This will help us catch bugs where the arguments are not in line
with the format string.

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

diff --git a/criu/include/util.h b/criu/include/util.h
index d1332ae..392fa8c 100644
--- a/criu/include/util.h
+++ b/criu/include/util.h
@@ -73,7 +73,8 @@ extern int set_proc_fd(int fd);
 #define PROC_GEN	-1
 #define PROC_NONE	-2
 
-extern int do_open_proc(pid_t pid, int flags, const char *fmt, ...);
+extern int do_open_proc(pid_t pid, int flags, const char *fmt, ...)
+	__attribute__ ((__format__ (__printf__, 3, 4)));
 
 #define __open_proc(pid, ier, flags, fmt, ...)				\
 	({								\
-- 
2.9.3



More information about the CRIU mailing list