tree-wide: mark log_struct with _printf_ and fix fallout

log_struct takes multiple format strings, each one followed by arguments.
The _printf_ annotation is not sufficiently flexible to express this,
but we can still annotate the first format string, though not its
arguments (because their number is unknown).

With the annotation, the places which specified the message id or similar
as the first pattern cause a warning from -Wformat-nonliteral. This can
be trivially fixed by putting the MESSAGE= first.

This change will help find issues where a non-literal is erroneously used
as the pattern.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2017-04-21 13:37:04 -04:00
parent c8304ba902
commit ba360bb05c
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -137,7 +137,7 @@ int log_format_iovec(
bool newline_separator,
int error,
const char *format,
va_list ap);
va_list ap) _printf_(6, 0);
/* This modifies the buffer passed! */
int log_dump_internal(