From: Michael Stapelberg Date: Sun, 5 Aug 2012 13:59:08 +0000 (+0200) Subject: log.h: tell the compiler these logging functions use printf-like formats X-Git-Tag: 4.3~134 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=991a9de0d7285fde26d354134068a2d30988dab7;p=i3%2Fi3 log.h: tell the compiler these logging functions use printf-like formats This gives us additional warnings and is supported in gcc and clang. --- diff --git a/include/log.h b/include/log.h index 11555ab7..d3e967e7 100644 --- a/include/log.h +++ b/include/log.h @@ -49,20 +49,23 @@ void set_verbosity(bool _verbose); * but only if debug logging was activated. * */ -void debuglog(char *fmt, ...); +void debuglog(char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); /** * Logs the given message to stdout while prefixing the current time to it. * */ -void errorlog(char *fmt, ...); +void errorlog(char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); /** * Logs the given message to stdout while prefixing the current time to it, * but only if verbose mode is activated. * */ -void verboselog(char *fmt, ...); +void verboselog(char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); /** * Logs the given message to stdout while prefixing the current time to it.