From: Zenith432 <zenith432@users.sourceforge.net>
To: "Gao, Liming" <liming.gao@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH 4/4] BaseTools: resolve initialization order errors in VfrFormPkg.h
Date: Sun, 10 Dec 2017 18:01:53 +0200 [thread overview]
Message-ID: <227fb275-6c49-48e9-f5b3-a00c7fcac909@users.sourceforge.net> (raw)
In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E18E283@SHSMSX104.ccr.corp.intel.com>
On 10/12/2017 03:52 PM, Gao, Liming wrote:
> I think these patches resolves CLANG build issues in BaseTools. Do you verify them with GCC or VS tool chain?
>
GCC 7.2 does not give any of the warnings generated by clang while compiling BaseTools.
After applying the 4 BaseTools patches, it still does not give any warnings (or errors).
I don't have VS toolchain to try on.
For VfrFormPkg.h, there is simpler solution to surround all the offending code in
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wuninitialized"
<offending code>
#pragma clang diagnostic pop
I sent you this option last week, you said you prefer to resolve the reason for the "-Wuninitialized".
The reason is the attempt in 100 or so derived classes to force an initialization order different than C++. It's
undefined behavior. Any resolution for the undefined behavior involves changing those 100 derived classes, so a massive
code change. The existing code works, it's just an attempt to get around standard C++ initialization order. Clang
wants to give pedantic warnings, but can be silenced if the "undefined behavioral" code is known to work.
The other 3 BaseTools patches are rather small.
Also, with the VA_START(Args, BOOLEAN) bug (bug 741), there is an option of silencing clang locally around the offending
statement
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wvarargs"
VA_START(Args, Iso639Language);
#pragma clang diagnostic pop
And then remove global silencing of this warning in tools_def.txt. That way any other not yet considered warnings will
be caught in the future.
It's up to you how to go about it... big code changes, silencing warning locally or silencing warning globally.
next prev parent reply other threads:[~2017-12-10 15:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1263998052.1770898.1512830709571.ref@mail.yahoo.com>
2017-12-09 14:45 ` [PATCH 4/4] BaseTools: resolve initialization order errors in VfrFormPkg.h Zenith432
2017-12-10 13:52 ` Gao, Liming
2017-12-10 16:01 ` Zenith432 [this message]
2017-12-11 14:21 ` Gao, Liming
2017-12-19 1:10 ` Gao, Liming
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-list 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=227fb275-6c49-48e9-f5b3-a00c7fcac909@users.sourceforge.net \
--to=devel@edk2.groups.io \
/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