* [Qemu-devel] Qemu build failure with uninitialized variables when "-Wmaybe-uninitialized" is open
@ 2019-02-28 3:00 Wei, Danmei
2019-02-28 16:41 ` Thomas Huth
0 siblings, 1 reply; 3+ messages in thread
From: Wei, Danmei @ 2019-02-28 3:00 UTC (permalink / raw)
To: qemu-devel@nongnu.org; +Cc: Hao, Xudong
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"
Thanks,
Danmei
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Qemu build failure with uninitialized variables when "-Wmaybe-uninitialized" is open
2019-02-28 3:00 [Qemu-devel] Qemu build failure with uninitialized variables when "-Wmaybe-uninitialized" is open Wei, Danmei
@ 2019-02-28 16:41 ` Thomas Huth
2019-03-01 1:32 ` Wei, Danmei
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2019-02-28 16:41 UTC (permalink / raw)
To: Wei, Danmei, qemu-devel@nongnu.org; +Cc: Hao, Xudong
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Qemu build failure with uninitialized variables when "-Wmaybe-uninitialized" is open
2019-02-28 16:41 ` Thomas Huth
@ 2019-03-01 1:32 ` Wei, Danmei
0 siblings, 0 replies; 3+ messages in thread
From: Wei, Danmei @ 2019-03-01 1:32 UTC (permalink / raw)
To: Thomas Huth, qemu-devel@nongnu.org; +Cc: Hao, Xudong
I got it. Many thanks.
Thanks,
Danmei
-----Original Message-----
From: Thomas Huth [mailto:thuth@redhat.com]
Sent: Friday, March 1, 2019 12:42 AM
To: Wei, Danmei <danmei.wei@intel.com>; qemu-devel@nongnu.org
Cc: Hao, Xudong <xudong.hao@intel.com>
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-01 1:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-28 3:00 [Qemu-devel] Qemu build failure with uninitialized variables when "-Wmaybe-uninitialized" is open Wei, Danmei
2019-02-28 16:41 ` Thomas Huth
2019-03-01 1:32 ` Wei, Danmei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).