[CRIU] [PATCH 4/5] compel std_printf: annotate with printf

Kir Kolyshkin kir at openvz.org
Mon Feb 13 16:59:38 PST 2017


This function works like printf, and it helps the compiler
to know that, so it can check whether arguments fit the
format string.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 compel/plugins/include/uapi/std/string.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compel/plugins/include/uapi/std/string.h b/compel/plugins/include/uapi/std/string.h
index ddc1ea3..5129017 100644
--- a/compel/plugins/include/uapi/std/string.h
+++ b/compel/plugins/include/uapi/std/string.h
@@ -14,7 +14,9 @@
 extern void __std_putc(int fd, char c);
 extern void __std_puts(int fd, const char *s);
 extern void __std_printk(int fd, const char *format, va_list args);
-extern void __std_printf(int fd, const char *format, ...);
+extern void __std_printf(int fd, const char *format, ...)
+	__attribute__ ((__format__ (__printf__, 2, 3)));
+
 
 #define std_printf(fmt, ...)	__std_printf(STDOUT_FILENO, fmt, ##__VA_ARGS__)
 #define std_puts(s)		__std_puts(STDOUT_FILENO, s)
-- 
2.9.3



More information about the CRIU mailing list