public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH] BaseTools/tools_def: Disable unneeded-internal-declaration warning in CLANGPDB
@ 2023-12-10 10:18 Mike Beaton
  2023-12-10 10:22 ` Mike Beaton
  2023-12-11 15:00 ` Laszlo Ersek
  0 siblings, 2 replies; 13+ messages in thread
From: Mike Beaton @ 2023-12-10 10:18 UTC (permalink / raw)
  To: devel; +Cc: ardb, Mike Beaton

From: Mike Beaton <mjsbeaton@gmail.com>

This warning was already disabled in CLANGDWARF by commit
d3225577123767fd09c91201d27e9c91663ae132.

gcc can distinguish between optimised-away variable usage (as  can occur in
valid debug code) and genuinely unused variables, and only complains about
the latter. clang cannot, and therefore this warning ends up complaining
about valid debug code under clang.

Since EDK-II code is in general going to be compiled by gcc as well as clang
then disabling this warning in clang does not amount to entirely removing
potentially valid warnings about genuinely unused variables.

Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
---
 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 c34ecfd557..48cf45245f 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -1754,7 +1754,7 @@ DEFINE CLANGPDB_X64_PREFIX           = ENV(CLANG_BIN)
 DEFINE CLANGPDB_IA32_TARGET          = -target i686-unknown-windows-gnu
 DEFINE CLANGPDB_X64_TARGET           = -target x86_64-unknown-windows-gnu
 
-DEFINE CLANGPDB_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-microsoft-enum-forward-reference
+DEFINE CLANGPDB_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 -Wno-microsoft-enum-forward-reference
 DEFINE CLANGPDB_ALL_CC_FLAGS         = DEF(GCC48_ALL_CC_FLAGS) DEF(CLANGPDB_WARNING_OVERRIDES) -fno-stack-protector -funsigned-char -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -Wno-null-dereference -mno-implicit-float -mms-bitfields -mno-stack-arg-probe -nostdlib -nostdlibinc -fseh-exceptions
 
 ###########################
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112259): https://edk2.groups.io/g/devel/message/112259
Mute This Topic: https://groups.io/mt/103087794/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-12-12 10:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-10 10:18 [edk2-devel] [PATCH] BaseTools/tools_def: Disable unneeded-internal-declaration warning in CLANGPDB Mike Beaton
2023-12-10 10:22 ` Mike Beaton
2023-12-10 10:25   ` Mike Beaton
2023-12-11 15:00 ` Laszlo Ersek
2023-12-11 15:18   ` Mike Beaton
2023-12-11 16:22     ` Laszlo Ersek
2023-12-11 17:26       ` Mike Beaton
2023-12-12  0:41         ` Laszlo Ersek
2023-12-12  7:17           ` Mike Beaton
2023-12-12  7:49             ` Ard Biesheuvel
2023-12-12  8:48               ` Mike Beaton
2023-12-12 10:12                 ` Mike Beaton
2023-12-12 10:30                   ` Mike Beaton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox