From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (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 811C521BB2527 for ; Tue, 20 Jun 2017 04:00:48 -0700 (PDT) Received: by mail-wm0-x231.google.com with SMTP id m125so18290206wmm.1 for ; Tue, 20 Jun 2017 04:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZZudXzyNBow8fuwhyOa9yeA98jLXHc8IFnIR6pyxAWU=; b=LyjOS2DtAarbutkfshHvPXjpveU9RMkbcf5oBRg5CdcGHEMAZQQWhnukz2XXItC+Nn m9tj7sOtmKXRAS5vNo8PVifAnDQfp41rWceX6Kkiq1fujqNNsFMph1duLHXQLhEg54Cm xbuM2ug5czwt+YFC9R4+aRTUPcB4M2FLnB05w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZZudXzyNBow8fuwhyOa9yeA98jLXHc8IFnIR6pyxAWU=; b=dVmIdPYGsBy4z/Ox2kcxiYVzcftOnHSA6dZWcLfg5MqMKcvzAZ/+EZyKNodOx6XltO nd/wRVQJUaWyaelvAbTE1lwebrUKidc3a0aPvcOlNTt6acYlbXWiQYNzdd7Uoszam5Vc B2Jm610V23cXU/S3SoFfylmpmZr7x8OAmj2iSLqJBn2NeZNM5MetRlRBrBq+QtYgeald fDbI4hJDTmIJPNJMVTsLZQLzcCZzWyUFJFYvtq2mwH2/E6MvuODl1CgZddLerO3XCWwr b6BgRkRMo/ztqPOskN8FmU+8qt6Rw8WXHU7hGFdJbO9iEkVZEv7CAuhxk7Q7kEzeRB/X 1KoQ== X-Gm-Message-State: AKS2vOw2KHQ/wKQRMMxDkx1+bsRzqmxSh5V4f8DhyTX0zubCu/RiXouG jsG4jeFnWAmf/wQ2wPg5Og== X-Received: by 10.28.103.193 with SMTP id b184mr2482038wmc.25.1497956529535; Tue, 20 Jun 2017 04:02:09 -0700 (PDT) Received: from mohikan.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id w128sm6398198wmd.7.2017.06.20.04.02.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 04:02:09 -0700 (PDT) From: Leif Lindholm To: edk2-devel@lists.01.org Cc: ard.biesheuvel@linaro.org, ryan.harkin@linaro.org Date: Tue, 20 Jun 2017 12:00:08 +0100 Message-Id: <20170620110008.24413-1-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [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:00:48 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- 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. 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