From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by mx.groups.io with SMTP id smtpd.web11.19555.1683730472200313690 for ; Wed, 10 May 2023 07:54:32 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm1 header.b=Pt/RYmQc; spf=pass (domain: bsdio.com, ip: 64.147.123.24, mailfrom: rebecca@bsdio.com) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 5658232007F0; Wed, 10 May 2023 10:54:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 10 May 2023 10:54:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1683730470; x=1683816870; bh=K8Gez2zM4b89+JY8kKyXOsiafvqqS7gS3/T PIrYGvu8=; b=Pt/RYmQclU6piwZJlzPtJBKhslOjkjgqG9cKZAYX2TYqsTQ74Qg ClfZPHm2xIQc1OGiSkZFxM1djhnbG6QrLB+d9tqF5movgTuS8O1wlkz7kPT3CquW MeLP1t1E/lkYBLy8jJyFMj8/sMI8ivIA6eZUy2e4HyyiFRo8QD6ffJNXoayU4/Ht PWaKz4UkZyFJE92GSv+iNsympWqGo94xkVVMpjTcOMP6mZuxEQs9vTeJQ0EqGKYs /3EkHaUnotwxnCpPFg3+MSPHxZrcl5b+tIjd6xbzh4Sv/eEkIw1l5IyRZ+9qurrh 9+gpfrdAoHw0kmKUmLnBZ4xzafBHnSkLVBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1683730470; x=1683816870; bh=K8Gez2zM4b89+JY8kKyXOsiafvqqS7gS3/T PIrYGvu8=; b=Fe5Uwy13om2VbsTJkF3OoIN4tr1lX1W2liIYEyyIBHOT+qxFxxl jiRluWW0ed/wQqK12aW/FNoKpwOH9rIOTdqFMbi5mr+0p0/vkOOS4PPliPvlAzwq bg3XJrGdh0mT+7b5DyOI96vdgXSY5j6sMv15a5Ce+JIz9c5aqHK0Yppv6qo62XXi opMA4sUWhjWY3iVsJvRLwAEoWC1Sa1zldmMUEs2/wjokt97rwmmTE7PYzIyHbE7E KkCYfTyaPS+EvojXY/cv3bLT1VWW+NiUXH/NXhucyTN8/qn1oyFwgNOQ6BHDSdL7 N3FVEYYieDAOqTh3n84EOIyqYo4Pksgf8jg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeegiedgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeftvggs vggttggrucevrhgrnhcuoehrvggsvggttggrsegsshguihhordgtohhmqeenucggtffrrg htthgvrhhnpeegveekffffgfelfffhleegveeihffguedthfdthfejgfejgfejgfffjeef gfehudenucffohhmrghinhepghhouggsohhlthdrohhrghenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrvggsvggttggrsegsshguihhordgt ohhm X-ME-Proxy: Feedback-ID: i5b994698:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 May 2023 10:54:30 -0400 (EDT) Message-ID: <58ec7070-d982-f738-26cc-d4726833dc87@bsdio.com> Date: Wed, 10 May 2023 08:54:29 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] BaseTools/tools_def: Disable overzealous unused variable warning on Clang To: Ard Biesheuvel , devel@edk2.groups.io Cc: Gerd Hoffmann , Liming Gao References: <20230510145008.1893553-1-ardb@kernel.org> From: "Rebecca Cran" In-Reply-To: <20230510145008.1893553-1-ardb@kernel.org> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reviewed-by: Rebecca Cran This should go in for the edk2-stable202305 release. -- Rebecca Cran On 5/10/23 08:50, Ard Biesheuvel wrote: > The warnings Clang emits when enabling -Wunneeded-internal-declaration > (which is part of -Wall) are generating false positives for variables > whose size gets taken but are not referenced beyond that. > > This may happen legitimately in debug code, so let's disable this > warning for Clang, rather than tiptoe around it in the code base. > > This fixes the RELEASE build for OVMF, which triggers this issue in the > newly added VirtioSerialDxe driver. > > Cc: Rebecca Cran > Cc: Gerd Hoffmann > Cc: Liming Gao > Signed-off-by: Ard Biesheuvel > --- > Reproducer: https://godbolt.org/z/zx6qqjKrK > > BaseTools/Conf/tools_def.template | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template > index b3c822f0bc20046d..65dde57631fb6c95 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -1858,7 +1858,7 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x22 > DEFINE CLANGDWARF_IA32_TARGET = -target i686-pc-linux-gnu > > DEFINE CLANGDWARF_X64_TARGET = -target x86_64-pc-linux-gnu > > > > -DEFINE CLANGDWARF_WARNING_OVERRIDES = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-unaligned-access > > +DEFINE CLANGDWARF_WARNING_OVERRIDES = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-unaligned-access -Wno-unneeded-internal-declaration > > DEFINE CLANGDWARF_ALL_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) DEF(CLANGDWARF_WARNING_OVERRIDES) -fno-stack-protector -mms-bitfields -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -msoft-float -mno-implicit-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -funsigned-char -fno-ms-extensions -Wno-null-dereference > > > > ########################### >