From 1fa57ac411cecc2fd877c207913c305aaf333ede Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 11 Feb 2014 14:38:34 +0100 Subject: [PATCH] Set printf format attribute for print(). This allows gcc to check format strings used in pr_* calls. Signed-off-by: Miroslav Lichvar --- print.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/print.h b/print.h index 56b2104..f5ed248 100644 --- a/print.h +++ b/print.h @@ -25,6 +25,9 @@ #define PRINT_LEVEL_MIN LOG_EMERG #define PRINT_LEVEL_MAX LOG_DEBUG +#ifdef __GNUC__ +__attribute__ ((format (printf, 2, 3))) +#endif void print(int level, char const *format, ...); void print_set_progname(const char *name);