From: Thomas Huth <thuth@redhat.com>
To: "Wei, Danmei" <danmei.wei@intel.com>,
"qemu-devel@nongnu.org" <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
Date: Thu, 28 Feb 2019 17:41:59 +0100 [thread overview]
Message-ID: <14b75ee9-7a5f-eb69-f210-f7b2e72cbaf8@redhat.com> (raw)
In-Reply-To: <38A2C2D0FB356A4785EEFA56D99BFB2B0B718883@SHSMSX101.ccr.corp.intel.com>
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
next prev parent reply other threads:[~2019-02-28 16:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2019-03-01 1:32 ` Wei, Danmei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14b75ee9-7a5f-eb69-f210-f7b2e72cbaf8@redhat.com \
--to=thuth@redhat.com \
--cc=danmei.wei@intel.com \
--cc=qemu-devel@nongnu.org \
--cc=xudong.hao@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).