From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-x22c.google.com (mail-qk0-x22c.google.com [IPv6:2607:f8b0:400d:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6533E21962338 for ; Tue, 20 Jun 2017 04:42:48 -0700 (PDT) Received: by mail-qk0-x22c.google.com with SMTP id d14so54985973qkb.1 for ; Tue, 20 Jun 2017 04:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=vgOZaC2dk9dlArd0y/YXE5axB8McPT/apY7R4x7+ccI=; b=JJYgfalZrFZpqJo1aw2ygOtMyAWkO7eqdzW0kPsD3UZD2WDDlosiKb+eqdQLrNHxK4 gRIf8aoT+jifu1uJLS+w67oYx0wfZVclgfRDnF0akjy0dLBnF8GvSmLoFvkxJ29Wl6p7 kIynhcEp0E1oPJNuYZMRNpMpnv7tINWVqbi3A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=vgOZaC2dk9dlArd0y/YXE5axB8McPT/apY7R4x7+ccI=; b=Y1uGSKx7H+56JiDnTWcGMBkH4Y8/k1bQXACmdne7qZiMdpX88S1OqUQw/Np13aLxY7 ypNktNpVyS3pxhL2P9U9rOIcr8p5ZKyOK0pwIwqaql41G/LHytlhF/MSNi3jP/nARsZw 089J4Cz8aKo7wgLJvZyoixRdEr76l6tgfoiCXtj3CbVmi8qjLX/pOJiyazSvq8ba/MqK w343NqMisEMDT9IO4ySgQ8WigRCGuVzuNx4RyzrHIM7/ZTgaQ4kdsIjxgW+StQmoEnAf P8pd5TyF4QBJgBLrpUgJjWUIrPlHAvEcaFav8vqUJX3IGPlbmguk1rZwaasnHtwdZGiZ KzTQ== X-Gm-Message-State: AKS2vOyG72NBJ1+WFZaDwmTFNmfDI7bmWn5bRWcaO8xTNP9/uTxocPyZ TBfQBiHOXVznZL409/MYDlMfWbLd9reP X-Received: by 10.55.189.66 with SMTP id n63mr34052311qkf.89.1497959050008; Tue, 20 Jun 2017 04:44:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.85.6 with HTTP; Tue, 20 Jun 2017 04:44:09 -0700 (PDT) In-Reply-To: References: <20170620110008.24413-1-leif.lindholm@linaro.org> From: Ryan Harkin Date: Tue, 20 Jun 2017 12:44:09 +0100 Message-ID: To: Ard Biesheuvel Cc: Leif Lindholm , Laszlo Ersek , "edk2-devel@lists.01.org" Subject: Re: [PATCH] ArmPlatformPkg: eliminate Juno gcc build warning X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 11:42:48 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 20 June 2017 at 12:28, Ard Biesheuvel wrote: > (+ Laszlo) > > On 20 June 2017 at 13:00, Leif Lindholm wrote: >> When building without LTO, gcc incorrectly resolves the hazards for >> 'PciRegBase=E2=80=99 when inlining, leading to "may be used uninitialize= d" >> 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 > > Reviewed-by: Ard Biesheuvel Reviewed-by: Ryan Harkin > >> --- >> >> 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 =3D 0; >> Status =3D InitPciDev (PciIo, &PciRegBase, &OldPciAttr); >> if (EFI_ERROR (Status)) { >> return Status; >> -- >> 2.11.0 >>