chiark / gitweb /
tree-wide: mark log_struct with _printf_ and fix fallout
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 20 Apr 2017 18:15:28 +0000 (14:15 -0400)
committerSven Eden <yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:46:52 +0000 (09:46 +0200)
commit14d2a81c8c1d4c06458c2ddcf89df28bc1de3602
treeeed7d2cab8e11b7be14aaf3d393d344cef6b82c3
parent7c3d5fdca2113db4a26c585061ee8ed1b159dd73
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.
src/basic/log.h