From patchwork Tue Jul 26 09:34:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 72788 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1587796qga; Tue, 26 Jul 2016 02:34:22 -0700 (PDT) X-Received: by 10.66.255.42 with SMTP id an10mr37960906pad.57.1469525662114; Tue, 26 Jul 2016 02:34:22 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id c69si38431733pfj.224.2016.07.26.02.34.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jul 2016 02:34:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2CBFD1A1DED; Tue, 26 Jul 2016 02:34:21 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AFAF61A1DEC for ; Tue, 26 Jul 2016 02:34:19 -0700 (PDT) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2390B3B715; Tue, 26 Jul 2016 09:34:19 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-23.phx2.redhat.com [10.3.116.23]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6Q9YHQR005700; Tue, 26 Jul 2016 05:34:17 -0400 To: Gary Lin , edk2-devel@ml01.01.org References: <20160726071817.17695-1-glin@suse.com> <20160726071817.17695-3-glin@suse.com> From: Laszlo Ersek Message-ID: Date: Tue, 26 Jul 2016 11:34:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160726071817.17695-3-glin@suse.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 26 Jul 2016 09:34:19 +0000 (UTC) Subject: Re: [edk2] [PATCH 02/19] Vlv2TbltDevicePkg: Don't define MDEPKG_NDEBUG for gcc X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Tim He , David Wei Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" On 07/26/16 09:18, Gary Lin wrote: > We enabled "-Wno-unused-but-set-variable" for gcc and it would complain > that the varible passed to ASSERT_EFI_ERROR wasn't used. Just don't > define MDEPKG_NDEBUG to make gcc happy with ASSERT_EFI_ERROR. > > Cc: David Wei > CC: Tim He > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Gary Lin > --- > Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc > index 9865785..e9ce1fc 100644 > --- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc > +++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc > @@ -1091,7 +1091,6 @@ [Components.X64] > !endif > > ICC:*_*_*_CC_FLAGS = -D MDEPKG_NDEBUG > - GCC:*_*_*_CC_FLAGS = -D MDEPKG_NDEBUG > } > MdeModulePkg/Universal/PCD/Dxe/Pcd.inf { > > "-D MDEPKG_NDEBUG" is fine for RELEASE builds. If you look at "BaseTools/Conf/tools_def.template", the RELEASE_GCC??_*_CC_FLAGS all have "-Wno-unused-but-set-variable", for GCC >= 4.6. Thus, for RELEASE builds, it's not a problem if a Status variable is only ever read with ASSERT_EFI_ERROR(), becuase for RELEASE builds, the warning is suppressed. See commit 20d00edf21d2f2144921622891d8b59a1553cd83. So, I recommend a different patch here: This matches OVMF too. Thanks Laszlo _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc index 98657851380e..05eb3c698fcc 100644 --- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc +++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc @@ -1091,7 +1091,7 @@ [Components.X64] !endif ICC:*_*_*_CC_FLAGS = -D MDEPKG_NDEBUG - GCC:*_*_*_CC_FLAGS = -D MDEPKG_NDEBUG + GCC:RELEASE_*_*_CC_FLAGS = -D MDEPKG_NDEBUG } MdeModulePkg/Universal/PCD/Dxe/Pcd.inf {