[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-5.1? v2] qapi/error: Check format string argument in erro
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH-for-5.1? v2] qapi/error: Check format string argument in error_*prepend() |
Date: |
Fri, 24 Jul 2020 11:33:29 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 7/24/20 10:03 AM, Markus Armbruster wrote:
> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>
>> error_propagate_prepend() "behaves like error_prepend()", and
>> error_prepend() uses "formatting @fmt, ... like printf()".
>> error_prepend() checks its format string argument, but
>> error_propagate_prepend() does not. Fix by addint the format
>
> s/addint/adding/
>
>> attribute to error_propagate_prepend() and error_vprepend().
>>
>> This would have caught the bug fixed in the previous commit:
>>
>> CC hw/sd/milkymist-memcard.o
>> hw/sd/milkymist-memcard.c: In function ‘milkymist_memcard_realize’:
>> hw/sd/milkymist-memcard.c:284:70: error: format ‘%s’ expects a matching
>> ‘char *’ argument [-Werror=format=]
>> 284 | error_propagate_prepend(errp, err, "failed to init SD
>> card: %s");
>> |
>> ~^
>> |
>> |
>> |
>> char *
>
> I see no need to repeat the details here. If you agree, I'll drop them
> in my tree.
OK, thanks.
>
>> Missed in commit 4b5766488f "error: Fix use of error_prepend() with
>> &error_fatal, &error_abort".
>>
>> Inspired-by: Stefan Weil <sw@weilnetz.de>
>> Suggested-by: Eric Blake <eblake@redhat.com>
>> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>