From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.19422.1683730217284388549 for ; Wed, 10 May 2023 07:50:17 -0700 Authentication-Results: mx.groups.io; dkim=fail, err=malformed MIME header line: Subject: [PATCH] BaseTools/tools_def: Disable overzealous unused variable warning on Clang; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B66C763B46; Wed, 10 May 2023 14:50:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED484C433EF; Wed, 10 May 2023 14:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683730216; bh=TmKxZzMvCeNI7zUVx6H+gVUHcTnc8eyeD3rGg4cCd7A=; h=From:To:Cc:Subject:Date:From; b=jGbZblvUgkow4y07MfhB9p6SWinjXj7Fbqa1J+I2BwHeDtUOuOGVvg3lV8bXhaAwz f2NQ+u8v0WclNu/DkZobKEyNRBLLaQ4NimBn1XriBG3FLPiG2A/6acDqV4hdkJ/3k4 dkhJe1aNctEP2yDlU+CnP9luQyE7DQZnEBuNdaVo4er3A+I+7QDSxRjXAL/SgByKA9 DVrAKhARRtKZYM17sbYmWbyrEOYkWXX7icrtTloZgMDT1OeYVhgrKkSSCzB4Hgmzvy U76XvEhjuzkqmn01usCwMGJyvkn5/7w5jlGI6JwxT1o/YdOGiw3M8aKUnJR7RrlLXe a7nbkxQpnrGtw== From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Rebecca Cran , Gerd Hoffmann , Liming Gao Subject: [PATCH] BaseTools/tools_def: Disable overzealous unused variable warning on Clang Date: Wed, 10 May 2023 16:50:08 +0200 Message-Id: <20230510145008.1893553-1-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The warnings Clang emits when enabling -Wunneeded-internal-declaration=0D (which is part of -Wall) are generating false positives for variables=0D whose size gets taken but are not referenced beyond that.=0D =0D This may happen legitimately in debug code, so let's disable this=0D warning for Clang, rather than tiptoe around it in the code base.=0D =0D This fixes the RELEASE build for OVMF, which triggers this issue in the=0D newly added VirtioSerialDxe driver.=0D =0D Cc: Rebecca Cran =0D Cc: Gerd Hoffmann =0D Cc: Liming Gao =0D Signed-off-by: Ard Biesheuvel =0D ---=0D Reproducer: https://godbolt.org/z/zx6qqjKrK=0D =0D BaseTools/Conf/tools_def.template | 2 +-=0D 1 file changed, 1 insertion(+), 1 deletion(-)=0D =0D diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.t= emplate=0D index b3c822f0bc20046d..65dde57631fb6c95 100755=0D --- a/BaseTools/Conf/tools_def.template=0D +++ b/BaseTools/Conf/tools_def.template=0D @@ -1858,7 +1858,7 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS =3D -Wl,--d= efsym=3DPECOFF_HEADER_SIZE=3D0x22=0D DEFINE CLANGDWARF_IA32_TARGET =3D -target i686-pc-linux-gnu=0D= =0D DEFINE CLANGDWARF_X64_TARGET =3D -target x86_64-pc-linux-gnu= =0D=0D =0D=0D -DEFINE CLANGDWARF_WARNING_OVERRIDES =3D -Wno-parentheses-equality -Wno-= tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-e= mpty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-opti= on -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-unaligned-a= ccess=0D=0D +DEFINE CLANGDWARF_WARNING_OVERRIDES =3D -Wno-parentheses-equality -Wno-= tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-e= mpty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-opti= on -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-unaligned-a= ccess -Wno-unneeded-internal-declaration=0D=0D DEFINE CLANGDWARF_ALL_CC_FLAGS =3D DEF(GCC48_ALL_CC_FLAGS) DEF(CLA= NGDWARF_WARNING_OVERRIDES) -fno-stack-protector -mms-bitfields -Wno-address= -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-r= edeclaration -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -msoft-float= -mno-implicit-float -ftrap-function=3Dundefined_behavior_has_been_optimiz= ed_away_by_clang -funsigned-char -fno-ms-extensions -Wno-null-dereference= =0D=0D =0D=0D ###########################=0D=0D -- =0D 2.39.2=0D =0D