From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web09.5677.1614673342180008428 for ; Tue, 02 Mar 2021 00:22:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=QBgy7knS; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=06956174af=daniel.schaefer@hpe.com) Received: from pps.filterd (m0150245.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1228J5Wh025680; Tue, 2 Mar 2021 08:22:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=pps0720; bh=qveQOD0o6WSX24XzZG97pUMAIp/OPOXHWICUumYbeHE=; b=QBgy7knSxK4ljL6xrm4km1/Q0JNyN2NbJ2PD9J+fDzQcL4q69g7QiOkFvEWLPIDHxrOK 3AU35jMejXd2N3qXnLgPZLQJGqGdkTRPPiG85e5Iolda1WXrXUlOsMdCh1+KT5cGhgLN T6rMmtdDDLcz9dDjqFA53xc87pmSxlHylEU9zOdku/C4jxbF3SYkA+2WBBmNhnNvRSip r4f8jpQyuvfZejnsc84xbNwroZ34Ch2b/L48i5OIAnPc7UfVC3VOvhF60OLkUbYU8K+H kEIWDjKcvVIuxI0nWQr+GaJXN2gq4EfZpHQ8JUdP3XgWCbMMDL1I9g7mvJWTGewVDPlh EA== Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0b-002e3701.pphosted.com with ESMTP id 36yf9h617p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 Mar 2021 08:22:13 +0000 Received: from G9W8456.americas.hpqcorp.net (exchangepmrr1.us.hpecorp.net [16.216.161.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2354.austin.hpe.com (Postfix) with ESMTPS id 0B1C89D; Tue, 2 Mar 2021 08:22:13 +0000 (UTC) Received: from G9W8456.americas.hpqcorp.net (2002:10d8:a15f::10d8:a15f) by G9W8456.americas.hpqcorp.net (2002:10d8:a15f::10d8:a15f) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 2 Mar 2021 08:22:12 +0000 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (15.241.52.13) by G9W8456.americas.hpqcorp.net (16.216.161.95) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Tue, 2 Mar 2021 08:22:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QN4ZHeW1x6ItXSsUGPVTQfDGKNtJrz9F6X6MN+Es8uY1NtebFz5iwu+yHGPOdRDnj/wITzyBlnW4L1g8SifVHbzdkRD22+xm9SJ0ELRpcar3l17cgHZbBhiwkTL0U/J1xstzwg7ygCEc2lzNaBqdZp7HJV2QwEJWgvXoXqsZsdSy7E43xzXbK4D+C1zoHKEHO9LxU5YVWriHffPPJXcCshozGD4L06H5pawDCeo6AWM+ei5aElzYN83Jg6dPmWBS4+L10AzMvWSv+1qJfsXdouP+06zvIA6D6DIEcBCBfmDxu4uuUVUUg7RGXIpuERZZqyFaxR2XpmlnJ5YI0oiUbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qveQOD0o6WSX24XzZG97pUMAIp/OPOXHWICUumYbeHE=; b=K/yENAZyJXsOMqlllskMwmrDQ33j17PekkF3Ace1J3xWaLwRR+EzjZwGB24EyoUbRYQvbAXjjj4uuV4vDWDzLZ5eJ1Z0FQYhsE17gJhcQYlA55LYheMI4mLQ+ihL3u5xRk/rd0EeFsAvioGx9T0VH1VQ6HDg7dwlxzTKIwbnes5WJqNnn0xluy6DWKPFZ8UbJw9K2e+nZD3TLkGfFT9+SWvPZ8891+EwkydCSXdKrM40ArxndtvPrh8DUu+W7vR4jLXHrxC7+rbvNoYPwxx4vQ2A8NtfAtN+c5ze7cffeCiZ5yJuFiNeTiRbcrxtM3Cl7+EH7tHg+DLJWkvs2M9Ajw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=hpe.com; Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) by DF4PR8401MB0507.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7605::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.29; Tue, 2 Mar 2021 08:22:11 +0000 Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::ad2c:ff74:846c:5318]) by DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::ad2c:ff74:846c:5318%7]) with mapi id 15.20.3890.029; Tue, 2 Mar 2021 08:22:11 +0000 From: "Daniel Schaefer" To: CC: Bob Feng , Liming Gao , Yuwei Chen , Derek Lin Subject: [PATCH v1 1/2] BaseTools: Make undefined VFR macro an error (GCC) Date: Tue, 2 Mar 2021 16:21:49 +0800 Message-ID: <20210302082150.15478-2-daniel.schaefer@hpe.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210302082150.15478-1-daniel.schaefer@hpe.com> References: <20210302082150.15478-1-daniel.schaefer@hpe.com> X-Originating-IP: [15.211.146.34] X-ClientProxiedBy: SG2PR02CA0066.apcprd02.prod.outlook.com (2603:1096:4:54::30) To DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from x360-nix.wireless.hpe.com (15.211.146.34) by SG2PR02CA0066.apcprd02.prod.outlook.com (2603:1096:4:54::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20 via Frontend Transport; Tue, 2 Mar 2021 08:22:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ea676618-ee82-49b4-e2f5-08d8dd544732 X-MS-TrafficTypeDiagnostic: DF4PR8401MB0507: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Eb1Mg05xu78f2Oa/DKb7Rv+f8rdolr0eaNErbHpNSVyIN0VOCKCChYGgG6IBxeOVygfqASBx9qolbIoe9Elll882He/F8deaKSlwqKxfVDgxEUsXSU8o6Nkh7gGRi1eA0GOTWlqQfTBcKKvr5I99BhPjKlSK4Dl6nYxWU0/COlxJsZe4M996B1J6p18d9cVakSirBjDtHb9vbAMnpEXNj7tOz2St7kkmSwDRbeHz27b7dkn+iUn/qHcNmafDrZJak6ViwNdKcTiQWclhHoESWmkR1GwMVJAQPSdlC6EzHkWC2tGLkJt9YDbXaAyuwMPqO6Rvcfbr4JGtY1yqZr6Lnc9Okmhxkz8TlqMlzDorviYW8+Xg5mhcsPfCGCE1cai9WyX7PcLcI/BACNUshf0TpmdrFSfJYpU8d7+QHPTBo0fWVaV85CBnB+4Pd5vZ80KjrQfD4HgiuRtSTzf7dl/Byl1wkXBSH0Nryg+HgDYrA6obXf5T6Fg5CpL2faw+Ee+FF9EzbLGDIxKo6M+YjVkfAQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(346002)(376002)(366004)(136003)(39860400002)(396003)(83380400001)(4326008)(36756003)(6916009)(16526019)(66556008)(66946007)(186003)(66476007)(5660300002)(26005)(316002)(54906003)(478600001)(2906002)(45080400002)(52116002)(2616005)(6666004)(7696005)(6486002)(86362001)(44832011)(8676002)(1076003)(8936002)(956004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?SFQcyH6BJrzsLzj9YpYTVXN5mgWX8vGZ1Bd5y4R/FuMsqpPeucJavvBK6AFd?= =?us-ascii?Q?ow1lrAznUznT1qIBmKPwUSSsa56Gyc8FmKulHOn0bNDUDaRjq7KS/PKfkbjh?= =?us-ascii?Q?p6rFUz7iRxxKLPOOwph7LlD30BeoY2u23NLJS8DQflT9QniA7EtnQI26SUx/?= =?us-ascii?Q?/H7SH456iD8phF70mczb5u80ozyXLIL3KyMJMEdNp9AigQMDi9z7sG/KbohY?= =?us-ascii?Q?cKJKqbyB6xxxrKUHLR8Mv5Ky3yVjpHzw8jcpUUnUsXGWSdcb+dFrwCTI9yD6?= =?us-ascii?Q?/g9GQgnNGwgk0E6+NH/gPwHaNs7WVKlcV7Z73NczgBsw0ikO5vud0VlnQ+QX?= =?us-ascii?Q?0BmxKPA+dsfW3Q3s7+HFUKon2l+LFXFupVjgrH+g8pNk5BKLEkuNKAbcwTVo?= =?us-ascii?Q?tfjduBeyhzXa11xDnIyqmqR9SWrnfhDtgKUa0UM1sGwKeUy9VCOxd6OWa3Zx?= =?us-ascii?Q?Gf3MsSG2QXo0TFadygHL1fRpQ1w7Y86wDFbjfA1M+nUG1hdbln5ufYfpPnNB?= =?us-ascii?Q?1TjOmkhjaEZyW+MXcvBqGGmgsMStYWYwQx9Zioq126xx1itKgtQvmzDhZWgX?= =?us-ascii?Q?W1U45OouMjQjOXG3aLEkP6Ym2I/u7BQm2eyBdEEmJjB0msWN69MB8UJ8CZuA?= =?us-ascii?Q?dYpVKPa/d1xge47LrS25P5oyqtTzwnLFe0f4TQRrdhA/jYvDe0GJXkfsTGVH?= =?us-ascii?Q?5h/ef6AlVr+TU8ONZsyQjAdA7KbK7JHPGCcucZkxstzBWOG9jNsASLC9iNh7?= =?us-ascii?Q?Km8iOrM1f+/5x3yk545jg507Gf/Qle0m2AFNJiOZtwDdWogJTH0FYSSlW6IM?= =?us-ascii?Q?jOYddF+QFn2xi3kpekrzOf9xMTtIM2ZwmDxsUQ17b0qrcv/DVmUwoewkr2Et?= =?us-ascii?Q?aKMxVey2i5nYlTmyoiIn0IYw7qlki8yLt9qS90Eh8/bixCIFIEoiKJ0yQfCp?= =?us-ascii?Q?iFlj6tANWZ0tnkxOb0360JRHNWT7Ra36ccRAdOmSrJY+/xx63it3c187fbW1?= =?us-ascii?Q?9OAcZ8sGRU7cygkRrM+uz8GlI+vpJqIShQ8ic2bluJcqCaJvJnPPE5/NeagK?= =?us-ascii?Q?1pYRcS95N4k6/UgDpQKAgvqTQbC4wXwV4WP5Vl6VSfqF4OaeEylOYPY2DdCz?= =?us-ascii?Q?T3w8eE2W/E11T8yi59tKGqCQue9QY+weQ3J8avR+iZgYdt3fwIlXddP0ABCh?= =?us-ascii?Q?8c7rQ4rwFGDprSDnGVFn5eZUgxjsit7frAtinooKa/5ozZHijJWZFfW56gx3?= =?us-ascii?Q?sylfFp0EtCLJCdKWztP7tkE+a5GaFOFRbFDJPm19AGMuG8IcMyrmSS1knkMM?= =?us-ascii?Q?vikJuwsvaRQ1WFtu0x8V9vmp?= X-MS-Exchange-CrossTenant-Network-Message-Id: ea676618-ee82-49b4-e2f5-08d8dd544732 X-MS-Exchange-CrossTenant-AuthSource: DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2021 08:22:11.7032 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7Tol95jL6nx5AvO3M70jX8B1nLbu3h/gEKHrjYa7M15Zq+JniOReGTOz4TniPI6sEiSal1HV3JKJtsGw2DmwTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB0507 X-OriginatorOrg: hpe.com X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-02_02:2021-03-01,2021-03-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 priorityscore=1501 mlxscore=0 clxscore=1015 phishscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103020069 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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. The behaviour is totally intended by the C/PP standard. When a macro is undefined it evaluates to 0. 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. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Cc: Derek Lin --- BaseTools/Conf/tools_def.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.t= emplate index 933b3160fd2b..728c1d3119e4 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -3,7 +3,7 @@ # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
= =0D # Portions copyright (c) 2011 - 2019, ARM Ltd. All rights reserved.
=0D # Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
=0D -# (C) Copyright 2020, Hewlett Packard Enterprise Development LP
=0D +# (C) Copyright 2020-2021, Hewlett Packard Enterprise Development LP
= =0D # Copyright (c) Microsoft Corporation=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D @@ -1938,7 +1938,7 @@ DEFINE GCC_AARCH64_ASLDLINK_FLAGS =3D DEF(GCC_AARCH6= 4_DLINK_FLAGS) -Wl,--entry,Re DEFINE GCC_IA32_X64_DLINK_FLAGS =3D DEF(GCC_IA32_X64_DLINK_COMMON) --en= try _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -M= ap $(DEST_DIR_DEBUG)/$(BASE_NAME).map=0D DEFINE GCC_ASM_FLAGS =3D -c -x assembler -imacros AutoGen.h= =0D DEFINE GCC_PP_FLAGS =3D -E -x assembler-with-cpp -include A= utoGen.h=0D -DEFINE GCC_VFRPP_FLAGS =3D -x c -E -P -DVFRCOMPILE --include $= (MODULE_NAME)StrDefs.h=0D +DEFINE GCC_VFRPP_FLAGS =3D -x c -E -P -DVFRCOMPILE --include $= (MODULE_NAME)StrDefs.h -Wundef -Werror=0D DEFINE GCC_ASLPP_FLAGS =3D -x c -E -include AutoGen.h=0D DEFINE GCC_ASLCC_FLAGS =3D -x c=0D DEFINE GCC_WINDRES_FLAGS =3D -J rc -O coff=0D --=20 2.30.0