[edk2-devel] [edk2-libc Patch 1/2] AppPkg/Applications/Enquire: Resolve CLANGPDB build issues

Michael D Kinney michael.d.kinney at intel.com
Tue Aug 31 21:49:30 UTC 2021


REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1618

Disable warnings for unused variables

This application has a #include statement to include itself
based on the built-in macro __FILE__.  However, this macro
is the full path to the file and the format of this file path
generates errors from CLANGPDB.  CLANGPDB provides a differnt
build-in macro called __FILE_NAME__ that is a relative path
instead of a full path and using this instead of __FILE__
resolves the issue.

Define __FILE__ to be __FILE_NAME__ and disable the warning
for redefining a build0in macro.

Cc: Rebecca Cran <rebecca at nuviainc.com>
Cc: Sivaraman <sivaramann at amiindia.co.in>
Signed-off-by: Michael D Kinney <michael.d.kinney at intel.com>
---
 AppPkg/Applications/Enquire/Enquire.inf | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/AppPkg/Applications/Enquire/Enquire.inf b/AppPkg/Applications/Enquire/Enquire.inf
index 090eec1..7322611 100644
--- a/AppPkg/Applications/Enquire/Enquire.inf
+++ b/AppPkg/Applications/Enquire/Enquire.inf
@@ -48,6 +48,7 @@
   LibWchar
 
 [BuildOptions]
-  INTEL:*_*_*_CC_FLAGS    = /Qdiag-disable:181,186
-   MSFT:*_*_*_CC_FLAGS    = /Od
-    GCC:*_*_*_CC_FLAGS    = -O0 -Wno-unused-variable
+     INTEL:*_*_*_CC_FLAGS = /Qdiag-disable:181,186
+      MSFT:*_*_*_CC_FLAGS = /Od
+       GCC:*_*_*_CC_FLAGS = -O0 -Wno-unused-variable
+  CLANGPDB:*_*_*_CC_FLAGS = -Wno-unused-variable -Wno-builtin-macro-redefined -D__FILE__=__FILE_NAME__
-- 
2.32.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80030): https://edk2.groups.io/g/devel/message/80030
Mute This Topic: https://groups.io/mt/85287996/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list