<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Ok sure, let's make only undef an error, not all other warnings. Then the behaviour will also be the same as on MSVC.<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Daniel Schaefer <daniel.schaefer@hpe.com><br>
<b>Sent:</b> Monday, March 8, 2021 11:44<br>
<b>To:</b> Feng, Bob C <bob.c.feng@intel.com>; devel@edk2.groups.io <devel@edk2.groups.io><br>
<b>Cc:</b> Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Lin, Derek (HPS SW) <derek.lin2@hpe.com><br>
<b>Subject:</b> Re: [edk2-devel] [PATCH v1 1/2] BaseTools: Make undefined VFR macro an error (GCC)</font>
<div> </div>
</div>
<div>
<div>It didn't cause any other errors for the huge HPE codebase. Only undefined macros. I don't believe the preprocessor has so many warnings anyways.</div>
<div>So -Werror should be fine.</div>
<div><br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Feng, Bob C <bob.c.feng@intel.com><br>
<b>Sent:</b> Monday, March 8, 2021 09:05<br>
<b>To:</b> devel@edk2.groups.io <devel@edk2.groups.io>; Schaefer, Daniel <daniel.schaefer@hpe.com><br>
<b>Cc:</b> Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Lin, Derek (HPS SW) <derek.lin2@hpe.com><br>
<b>Subject:</b> RE: [edk2-devel] [PATCH v1 1/2] BaseTools: Make undefined VFR macro an error (GCC)</font>
<div> </div>
</div>
<div class="x_BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="x_PlainText">Hi Derek,<br>
<br>
-Werror.  Make all warnings into errors.<br>
<br>
Should here be that only treat undef warning as error?<br>
<br>
Thanks,<br>
Bob<br>
<br>
-----Original Message-----<br>
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Daniel Schaefer<br>
Sent: Tuesday, March 2, 2021 4:22 PM<br>
To: devel@edk2.groups.io<br>
Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Derek Lin <derek.lin2@hpe.com><br>
Subject: [edk2-devel] [PATCH v1 1/2] BaseTools: Make undefined VFR macro an error (GCC)<br>
<br>
VFR successfully compiles if we forget to include a header that defines a macro. In that case the HII option was hidden when it shouldn't be just because the macro was used but not defined.<br>
<br>
The behaviour is totally intended by the C/PP standard. When a macro is undefined it evaluates to 0.<br>
GCC, MSVC and Clang have warnings to catch this type of mistake. With this commit we enable this warning and make it a compiler error.<br>
<br>
Cc: Bob Feng <bob.c.feng@intel.com><br>
Cc: Liming Gao <gaoliming@byosoft.com.cn><br>
Cc: Yuwei Chen <yuwei.chen@intel.com><br>
Cc: Derek Lin <derek.lin2@hpe.com><br>
---<br>
 BaseTools/Conf/tools_def.template | 4 ++--<br>
 1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template<br>
index 933b3160fd2b..728c1d3119e4 100755<br>
--- a/BaseTools/Conf/tools_def.template<br>
+++ b/BaseTools/Conf/tools_def.template<br>
@@ -3,7 +3,7 @@<br>
 #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>  #  Portions copyright (c) 2011 - 2019, ARM Ltd. All rights reserved.<BR>  #  Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR> -#  (C) Copyright 2020, Hewlett Packard
 Enterprise Development LP<BR><br>
+#  (C) Copyright 2020-2021, Hewlett Packard Enterprise Development <br>
+LP<BR><br>
 #  Copyright (c) Microsoft Corporation<br>
 #<br>
 #  SPDX-License-Identifier: BSD-2-Clause-Patent @@ -1938,7 +1938,7 @@ DEFINE GCC_AARCH64_ASLDLINK_FLAGS  = DEF(GCC_AARCH64_DLINK_FLAGS) -Wl,--entry,Re<br>
 DEFINE GCC_IA32_X64_DLINK_FLAGS    = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map<br>
 DEFINE GCC_ASM_FLAGS               = -c -x assembler -imacros AutoGen.h<br>
 DEFINE GCC_PP_FLAGS                = -E -x assembler-with-cpp -include AutoGen.h<br>
-DEFINE GCC_VFRPP_FLAGS             = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h<br>
+DEFINE GCC_VFRPP_FLAGS             = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h -Wundef -Werror<br>
 DEFINE GCC_ASLPP_FLAGS             = -x c -E -include AutoGen.h<br>
 DEFINE GCC_ASLCC_FLAGS             = -x c<br>
 DEFINE GCC_WINDRES_FLAGS           = -J rc -O coff<br>
--<br>
2.30.0<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</span></font></div>

</div>
</body>
</html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/74385">View/Reply Online (#74385)</a> |    |  <a target="_blank" href="https://groups.io/mt/82306124/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>