Eric Blake <ebl...@redhat.com> writes: > On 07/21/2017 08:53 AM, Markus Armbruster wrote: >> qtest_qmp() & friends pass their format string and variable arguments >> to qobject_from_jsonv(). Unlike qobject_from_jsonv(), they aren't >> decorated with GCC_FMT_ATTR(). Fix that to get compile-time format >> string checking. >> >> Signed-off-by: Markus Armbruster <arm...@redhat.com> >> --- >> tests/libqtest.h | 40 ++++++++++++++++++++++++---------------- >> 1 file changed, 24 insertions(+), 16 deletions(-) > > Don't know how much of this to merge with my fixed version of 2/9. But > matches what I had locally after my version 1, before I ripped it all > back out again prior to posting my v2 when dealing with gcc fallout, > that you've now corrected. > >> @@ -65,7 +66,8 @@ void qtest_qmp_discard_response(QTestState *s, const char >> *fmt, ...); >> * >> * Sends a QMP message to QEMU and returns the response. >> */ >> -QDict *qtest_qmp(QTestState *s, const char *fmt, ...); >> +QDict *qtest_qmp(QTestState *s, const char *fmt, ...) >> + GCC_FMT_ATTR(2, 3); > > This would fit on one line; any reason we need the line wrap?
Pretty sure I didn't have reasons. But I can make some up after the fact! Putting the attribute on a separate line can be a bit more legible. It can also confuse simple tools to recognize a definition instead of a declaration. Anyway, I don't really care about this line break.