From: Jens Axboe Date: Mon, 15 Apr 2013 09:40:30 +0000 (+0200) Subject: log: add printf() attribute to log_*() functions X-Git-Tag: fio-2.1~33 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=7089165b973c6bc48e11cadcb5a39c7adbae124c;hp=e9d806fa2661cf685fc5c5d0172ff15193c9c8b1 log: add printf() attribute to log_*() functions Similarly to how it's done for dprint(), so we can catch format errors. Signed-off-by: Jens Axboe --- diff --git a/log.h b/log.h index ad9d08bb..25f92f9e 100644 --- a/log.h +++ b/log.h @@ -7,9 +7,9 @@ extern FILE *f_out; extern FILE *f_err; -extern int log_err(const char *format, ...); -extern int log_info(const char *format, ...); -extern int log_local(const char *format, ...); +extern int log_err(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); +extern int log_info(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); +extern int log_local(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); extern int log_valist(const char *str, va_list); extern int log_local_buf(const char *buf, size_t);