[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] qapi-commands.py generates code that uses uninitialized
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] qapi-commands.py generates code that uses uninitialized variables |
Date: |
Fri, 28 Mar 2014 14:19:58 +0000 |
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>
thanks
-- PMM