mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
compel std_printf: annotate with printf
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@openvz.org> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
6b5b2996d4
commit
026968f63a
@@ -14,7 +14,9 @@
|
|||||||
extern void __std_putc(int fd, char c);
|
extern void __std_putc(int fd, char c);
|
||||||
extern void __std_puts(int fd, const char *s);
|
extern void __std_puts(int fd, const char *s);
|
||||||
extern void __std_printk(int fd, const char *format, va_list args);
|
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_printf(fmt, ...) __std_printf(STDOUT_FILENO, fmt, ##__VA_ARGS__)
|
||||||
#define std_puts(s) __std_puts(STDOUT_FILENO, s)
|
#define std_puts(s) __std_puts(STDOUT_FILENO, s)
|
||||||
|
Reference in New Issue
Block a user