qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e


From: Eric Blake
Subject: Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
Date: Mon, 25 Feb 2019 08:13:35 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0

Adding people in cc based on 'scripts/get-maintainer.pl -f
qobject/block-qdict.c'

On 2/22/19 6:35 PM, Andrew Randrianasulu wrote:
> Hello!
> 
> I just pulled latest git
> 
> up to 
> commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 (HEAD -> master, 
> origin/master, 
> origin/HEAD)
> Merge: a05838cb2a 2b6326c0bf
> Author: Peter Maydell <address@hidden>
> Date:   Fri Feb 22 15:48:04 2019 +0000

> and default build with simple ./configure on slackware 14.2 x86-64 box failed 
> like this:
> 

> qobject/block-qdict.c: In function 'qdict_array_split':
> qobject/block-qdict.c:259:9: error: 'subqdict' may be used uninitialized in 
> this 
> function [-Werror=maybe-uninitialized]
>          qlist_append_obj(*dst, subqobj ?: QOBJECT(subqdict));
>          ^

Appears to be a false positive, but one that the compiler can't see
through (that is, subqdict is only used if subqobj is NULL, but proving
that all code paths either set subqobj or subqdict is not trivial for
the compiler).  I suspect this would fix it.

diff --git i/qobject/block-qdict.c w/qobject/block-qdict.c
index 1487cc5dd8b..b26524429c0 100644
--- i/qobject/block-qdict.c
+++ w/qobject/block-qdict.c
@@ -224,7 +224,7 @@ void qdict_array_split(QDict *src, QList **dst)
     for (i = 0; i < UINT_MAX; i++) {
         QObject *subqobj;
         bool is_subqdict;
-        QDict *subqdict;
+        QDict *subqdict = NULL;
         char indexstr[32], prefix[32];
         size_t snprintf_ret;

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]