qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Qemu build failure with uninitialized variables when "-


From: Wei, Danmei
Subject: Re: [Qemu-devel] Qemu build failure with uninitialized variables when "-Wmaybe-uninitialized" is open
Date: Fri, 1 Mar 2019 01:32:27 +0000

I got it. Many thanks.

Thanks,
        Danmei

-----Original Message-----
From: Thomas Huth [mailto:address@hidden 
Sent: Friday, March 1, 2019 12:42 AM
To: Wei, Danmei <address@hidden>; address@hidden
Cc: Hao, Xudong <address@hidden>
Subject: Re: [Qemu-devel] Qemu build failure with uninitialized variables when 
"-Wmaybe-uninitialized" is open

On 28/02/2019 04.00, Wei, Danmei wrote:
> Hi,
> 
> When we build qemu with "-Wmaybe-uninitialized" on, and got the following 
> error information.
>   CC      qobject/json-streamer.o
>   CC      qobject/json-parser.o
>   CC      qobject/block-qdict.o
> qobject/block-qdict.c: In function 'qdict_array_split':
> qobject/block-qdict.c:259:25: error: 'subqdict' may be used uninitialized in 
> this function [-Werror=maybe-uninitialized]
>          qlist_append_obj(*dst, subqobj ?: QOBJECT(subqdict));
>                          ^
> cc1: all warnings being treated as errors
> make: *** [qobject/block-qdict.o] Error 1
> 
> It is because of the uninitialized variable subqdict function 
> qdict_array_split.
> Thanks to confirm it.
> 
> Below is the ENV Setting:
> OS: RHEL OS 7.6
> Qemu Version: commit c102d9471f8f02d9fbea72ec4505d7089173f470
> CFLAGS Setting in env: export CFLAGS="-g -O3 -Wmaybe-uninitialized"

Don't build QEMU with -O3 and -Wmaybe-uninitialized and -Werror together. -O3 
produces lots of false warnings with -Wmaybe-uninitialized, so we currently 
don't support building QEMU with that combination. You should at least add 
"-Wno-error=maybe-uninitialized" if you want to build that way.

 Thomas

reply via email to

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