From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (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 40AA721C8F61F for ; Tue, 20 Jun 2017 04:27:17 -0700 (PDT) Received: by mail-io0-x230.google.com with SMTP id t87so82503461ioe.0 for ; Tue, 20 Jun 2017 04:28:39 -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=D5bK6wQuoyNpdd98H0H+GmyEDOZbdAtgN27bwT3TR8Y=; b=UHF70n04JcGO++qTm0ppUwjcNIWaVDZIK/8WQ5P6aMaDoAiswEJsX3q3bXlOeA7NXm ljWOJnwCiTA3EJbOpoG4tbdeSrTf3xfi2F6Gs+kdi+9xsf6nPvwkTquT13VNs3cHy6vk FzkxUSr1eiM9c210nAxlzQYbZpJf4eRLZcVSI= 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=D5bK6wQuoyNpdd98H0H+GmyEDOZbdAtgN27bwT3TR8Y=; b=tGhY9JhmftnYc7e+LH4bnDrVQHNVpN8IgBVxMH1rJsz6KIjbnFPajAj9meWLJeT+Lo O6qVu0N2ah4oEkh2dpVwMdKeH3lj3dceQzNfkpoO3yPrryyNNLsNk5UAVGYSBUiqmO47 PVolZ7uBc9cpktsGmq5iO+qClOPfUdGozUIsNp9a9uWcsdn/uFr0rOAy5qdtM6Cwcxf9 N0NaHYTRTwq22TdTb79QQp7gZ7UbRcdXLEwQ6XtyWrTeRb6Tm/ahEDP0bSYH6GNdvci0 FCt1PxCl63sv6n0TpbQqPyxRag2Bb1tNY8hvMRnoO3rtl5jNe31z2RGj6BuRPaX81k+j 5TQw== X-Gm-Message-State: AKS2vOx1q5jVwq0gjYqNH3S9CNjDv/aTlERaQHiyA3dGYSJRTjU/dns8 UqIfFiYGmL+vLjyQaHxGkeiXEpw9dze4 X-Received: by 10.107.180.20 with SMTP id d20mr25500453iof.47.1497958119031; Tue, 20 Jun 2017 04:28:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.164.76 with HTTP; Tue, 20 Jun 2017 04:28:38 -0700 (PDT) In-Reply-To: <20170620110008.24413-1-leif.lindholm@linaro.org> References: <20170620110008.24413-1-leif.lindholm@linaro.org> From: Ard Biesheuvel Date: Tue, 20 Jun 2017 13:28:38 +0200 Message-ID: To: Leif Lindholm , Laszlo Ersek Cc: "edk2-devel@lists.01.org" , Ryan Harkin 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:27:17 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable (+ 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 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 Reviewed-by: Ard Biesheuvel > --- > > 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 >