[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 9/9] tests/libqtest: Enable compile-time format
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 9/9] tests/libqtest: Enable compile-time format string checking |
Date: |
Thu, 27 Jul 2017 10:36:27 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Eric Blake <address@hidden> 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 <address@hidden>
>> ---
>> 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.
- Re: [Qemu-devel] [PATCH 2/9] qtest: Document calling conventions, (continued)