compel_print_on_level(): 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:
Kir Kolyshkin 2017-02-13 16:59:37 -08:00 committed by Andrei Vagin
parent b1245247e2
commit 6b5b2996d4

View file

@ -15,7 +15,8 @@ static inline int pr_quelled(unsigned int loglevel)
}
extern void compel_print_on_level(unsigned int loglevel,
const char *format, ...);
const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
#define pr_msg(fmt, ...) \
compel_print_on_level(COMPEL_LOG_MSG, \