On Tue, Jun 20, 2017 at 12:44:09PM +0100, Ryan Harkin wrote:
> On 20 June 2017 at 12:28, Ard Biesheuvel <[email protected]> wrote:
> > (+ Laszlo)
> >
> > On 20 June 2017 at 13:00, Leif Lindholm <[email protected]> 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 <[email protected]>
> >
> > Reviewed-by: Ard Biesheuvel <[email protected]>
>
> Reviewed-by: Ryan Harkin <[email protected]>
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
> >>
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel