[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] qapi-commands.py generates code that uses uninitialized
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] qapi-commands.py generates code that uses uninitialized variables |
Date: |
Thu, 10 Apr 2014 19:40:54 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
On 03/28/2014 08:19 AM, Peter Maydell wrote:
> On 20 March 2014 19:21, Michael Roth <address@hidden> wrote:
>> Could it be as simple as this?:
>>
>> diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
>> index 9734ab0..a70482e 100644
>> --- a/scripts/qapi-commands.py
>> +++ b/scripts/qapi-commands.py
>> @@ -99,7 +99,7 @@ bool has_%(argname)s = false;
>> argname=c_var(argname), argtype=c_type(argtype))
>> else:
>> ret += mcgen('''
>> -%(argtype)s %(argname)s;
>> +%(argtype)s %(argname)s = {0};
>> ''',
>> argname=c_var(argname), argtype=c_type(argtype))
>
> Well, clang doesn't complain about this syntax, and it
> fixes the warnings about bools (which is good, because
> there was a genuine bug in dma-helpers.c that was hiding
> in amongst these other similar warnings...)
>
> Tested-by: Peter Maydell <address@hidden>
We uncovered a real bug that would be fixed by this patch:
https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg01745.html
Is it worth cleaning this up into a formal submission and cc'ing
qemu-stable and/or trying for the 2.0 release? If made formal, feel
free to add:
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] qapi-commands.py generates code that uses uninitialized variables,
Eric Blake <=