From: Leif Lindholm <leif.lindholm@linaro.org>
To: Ryan Harkin <ryan.harkin@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Laszlo Ersek <lersek@redhat.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] ArmPlatformPkg: eliminate Juno gcc build warning
Date: Tue, 20 Jun 2017 13:04:11 +0100 [thread overview]
Message-ID: <20170620120411.GA26676@bivouac.eciton.net> (raw)
In-Reply-To: <CAD0U-hKOs+1gYf1YwhgG_ShzQXpX4pChPGMyCthci9dy8VBR8g@mail.gmail.com>
On Tue, Jun 20, 2017 at 12:44:09PM +0100, Ryan Harkin wrote:
> On 20 June 2017 at 12:28, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> > (+ Laszlo)
> >
> > On 20 June 2017 at 13:00, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> >> When building without LTO, gcc incorrectly resolves the hazards for
> >> 'PciRegBase’ when inlining, leading to "may be used uninitialized"
> >> warnings (and hence build failure with -Werror).
> >> Eliminate this warning by explicitly initializing the variable to 0.
> >>
> >> Contributed-under: TianoCore Contribution Agreement 1.0
> >> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> >
> > Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
Thanks!
Pushed as 2f93c5077f.
> >
> >> ---
> >>
> >> For those who have heard me mentioning this before but arguing against
> >> upstreaming this patch: I only just tweaked that this warning doesn't
> >> go away with more recent toolchains, but simply when switching to GCC5
> >> build profile, and hence LTO. Build failure still reproducible with
> >> gcc 6.3.1 and GCC49.
> >>
> >
> > /me annoyed
> >
> > We keep hitting this with GCC, and I profoundly dislike having to add
> > redundant initialization sequences. Is there any other solution
> > possible, e.g., disable this warning for certain builds?
> >
> >> ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >> diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
> >> index da93eb5829..18491c7378 100644
> >> --- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
> >> +++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
> >> @@ -343,6 +343,7 @@ ArmJunoSetNicMacAddress ()
> >> return Status;
> >> }
> >>
> >> + PciRegBase = 0;
> >> Status = InitPciDev (PciIo, &PciRegBase, &OldPciAttr);
> >> if (EFI_ERROR (Status)) {
> >> return Status;
> >> --
> >> 2.11.0
> >>
next prev parent reply other threads:[~2017-06-20 12:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-20 11:00 [PATCH] ArmPlatformPkg: eliminate Juno gcc build warning Leif Lindholm
2017-06-20 11:28 ` Ard Biesheuvel
2017-06-20 11:44 ` Ryan Harkin
2017-06-20 12:04 ` Leif Lindholm [this message]
2017-06-20 12:00 ` Leif Lindholm
2017-06-20 15:44 ` Laszlo Ersek
2017-06-20 19:52 ` Ard Biesheuvel
2017-06-20 19:57 ` Laszlo Ersek
2017-06-20 20:05 ` Leif Lindholm
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=20170620120411.GA26676@bivouac.eciton.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