Set printf format attribute for print().

This allows gcc to check format strings used in pr_* calls.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
master
Miroslav Lichvar 2014-02-11 14:38:34 +01:00 committed by Richard Cochran
parent 661639420c
commit 1fa57ac411
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,9 @@
#define PRINT_LEVEL_MIN LOG_EMERG #define PRINT_LEVEL_MIN LOG_EMERG
#define PRINT_LEVEL_MAX LOG_DEBUG #define PRINT_LEVEL_MAX LOG_DEBUG
#ifdef __GNUC__
__attribute__ ((format (printf, 2, 3)))
#endif
void print(int level, char const *format, ...); void print(int level, char const *format, ...);
void print_set_progname(const char *name); void print_set_progname(const char *name);