From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web08.330.1613608747840930478 for ; Wed, 17 Feb 2021 16:39:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=SKC/wcnX; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: yuwei.chen@intel.com) IronPort-SDR: 9UoEBHL4djkqMBTcixvMxKbA7ctCKSPp1dcqEybUyUla+RJfpmTfE/JT5+TsKcWLp+UzN62s8t zZQYhAuQ+jLg== X-IronPort-AV: E=McAfee;i="6000,8403,9898"; a="202595175" X-IronPort-AV: E=Sophos;i="5.81,185,1610438400"; d="scan'208";a="202595175" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2021 16:39:06 -0800 IronPort-SDR: 9DMAPMDJY8/9TnEkID8qKCnvWyP60eE8HNNyQ5XybSv6JsKrorglK6m4XT8a2N2pivA8vEBJKq /cq1vCJQc5rg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,185,1610438400"; d="scan'208";a="400211515" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga008.jf.intel.com with ESMTP; 17 Feb 2021 16:39:06 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 17 Feb 2021 16:39:05 -0800 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 17 Feb 2021 16:39:05 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Wed, 17 Feb 2021 16:39:05 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Wed, 17 Feb 2021 16:39:05 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JYBWflZvGjwEUaZ7pViJH3RapgQn0FfaC7bMarVxztFwPDdWQ7pvNanFNyL/08gFqX7bpDdTX882NIEVJOgrgNBqGns9kFPTB6OKg3BXN8Ec2s1/svFflGkJ5gVHrPELQ8Cs6AbQSxR8v7KQdT74Z7Cf6hYBh2KoTWjK2nSO4N9P0BOfooxX8loLWmyffUgn4Wh+q2kEPU26ZVnpGzdmmFmcOwk1yf88W7j+f2mpxrkYoKwWSrZ4wscCe5mBsQ6ugjuUY3TFBVTAviyXE9XnQQBtvJqpb7ijqNdGryUDh89AlaxADqI2F0cF53YUBKx2EmAw5+o3oCjyZBzMiq2a2g== 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=UqEitRAq/5DPkzIAB2vwbCDCsetEDqw9ihtAydrNLTY=; b=J8YvOVnKJmL+YvwpoP9OLuWIlrhLS22VZr7JhA6fItt/Dodic72721C1Yu3dVg2h9pKSzbgI5sBE0hXNf3GTwaP1KZWlHcRb9hapHC1OPddQfSYdPlICM5qFXPxED/KfOO2r6scAEXHQCbrgcEfbZk0F6yOxs8wPHWEWUOSQ42/KHBQPl4RXTeatIvpRmFSNcA+7PQ/B0IJgDJUbgcKakrWZGzfTgrS/aZ6QlZMAAh2VNblem3AWpDDiRjH9q4kDQIibF7Cf+iFJTr2iZ6XOAo01OkVxh6ptO/MxLkHTWv9n6KKdeC4FCsDvbpCC89Kyw/XBBD0IORSgSE9nOdYSIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UqEitRAq/5DPkzIAB2vwbCDCsetEDqw9ihtAydrNLTY=; b=SKC/wcnXrnSaoz5/GC9+AgEu5eWrMRSnUBTzjM2wkarUfiqufSGxF1+gvtTkDij6CJJF4aBWUcKiXYoP/P1OWAxQ9GB+vPCBYpZBiwZH1IZAWBHKMU2Lk1nQliFnxJ4rH3RZjMcHwcweNnxa7Oz5XKoUnyF033p2xr+D/XUirIY= Received: from DM5PR11MB1594.namprd11.prod.outlook.com (2603:10b6:4:5::16) by DM6PR11MB4345.namprd11.prod.outlook.com (2603:10b6:5:202::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 18 Feb 2021 00:39:03 +0000 Received: from DM5PR11MB1594.namprd11.prod.outlook.com ([fe80::3d4e:e51a:c6ff:dcc6]) by DM5PR11MB1594.namprd11.prod.outlook.com ([fe80::3d4e:e51a:c6ff:dcc6%2]) with mapi id 15.20.3846.042; Thu, 18 Feb 2021 00:39:03 +0000 From: "Yuwei Chen" To: "devel@edk2.groups.io" , "pierre.gondois@arm.com" , "Feng, Bob C" , "gaoliming@byosoft.com.cn" , "rebecca@nuviainc.com" , "sami.mujawar@arm.com" CC: "leif@nuviainc.com" Subject: Re: [edk2-devel] [PATCH v2 1/1] BaseTools: Align include guards policy Thread-Topic: [edk2-devel] [PATCH v2 1/1] BaseTools: Align include guards policy Thread-Index: AQHXBEY5vZILZV7CY0C51iTldD1bAqpdEUiA Date: Thu, 18 Feb 2021 00:39:03 +0000 Message-ID: References: <20210216092907.27870-1-Pierre.Gondois@arm.com> In-Reply-To: <20210216092907.27870-1-Pierre.Gondois@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8af95410-2074-45c3-2462-08d8d3a59794 x-ms-traffictypediagnostic: DM6PR11MB4345: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jTPhksknUZt76QeiZmvI0g+o48iO4oYkrILugPx0jg0hAbuoXuHJn7V5Brv2k1TU2tqBrgnNuwQkZzayfhmLeFrzqaEuBheHvUqrkHetPg/BXN68HNW/rqDsJ2adBibVdlCZ5zPMz0BBbo3qRme32xxlPC26rollU9d22gc2RcS9RwF6/J//PTeTZ/uXZ1xdo8KVdOUhpPGiU23Eqb55q/vBWGXlageHT0qA5NmyAhiLxlXtJ+vhqW/nwYpNvwUFmqtFn5asWQDML7lRqp8oxOxWwkpI7Ehi4nOg4mSiDQqd8QKe555P+oPDSEdalXBSiB0PSF8KQII+AUK62Q9YsrLtAVx9gawxSI4d0/jqLrZdluHtDmb23XOuo50Jikbs9/QWzu1AKa2cngQ/Ld44JuHB4M0xpu4Miep74s5iW2C+PK4OZ8HSCxR6A9nueEd/FAtzJQ68YJFbdQmHTGkPj1GkkZi1QfXDrcq2Z7aFyFSFBesvHgiT9zOrNDmIf/CgbG6yz8vVpybVmSSiflUnS7bRGX2CJnESWVSntjd6VsHpcVym6Q7najy5fibnkL7dlMb4715UWXkMzC5Sn8qiAXiaZKUeuEsJmRW1o10MXtc= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR11MB1594.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(136003)(396003)(346002)(366004)(376002)(33656002)(83380400001)(6506007)(52536014)(478600001)(2906002)(316002)(7696005)(8936002)(53546011)(8676002)(66556008)(186003)(9686003)(64756008)(66946007)(66476007)(66446008)(4326008)(110136005)(5660300002)(966005)(86362001)(76116006)(26005)(71200400001)(55016002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?lRnHw9IHmtuAZOEb+otU8C0IKb+RScb6Z+DIcU3EaYL2eQOtit0+JOGxiww3?= =?us-ascii?Q?AY796+ItzMWTIfVNcZPDLq0HUlfWpDEU8FWYn1sBoNbsXWxG+ABUkUQEDdB3?= =?us-ascii?Q?x0XmIteE/ZfXl7ZW6nzaznQI7D3CtTCIe4rjnTw/il9g8XiUQad+O80uDRZa?= =?us-ascii?Q?MZzCWu1FXgSowxzguWb5sWiGpoi61U/0TWjGPoOqWENwomEAomhbDYiMQUcG?= =?us-ascii?Q?yZqoWPKlxL7N6p9AA4nNNtPGqWMfUEeUqrJfWJgvKCb/pUuInLdzarpe8+eP?= =?us-ascii?Q?G4ZriayCOoFM59hLxcge/STcbljHxA5Z2UQbpCrFBTVckIom2piv169eZkOh?= =?us-ascii?Q?3jstDp6JrgMiSt8xQrs0qLagB0KuClzTU2vkv8CSamig4leAr8RM+u1jr6mS?= =?us-ascii?Q?FnzYzUn6WSV5H8oNQ6j4nJqw/GBbX9a0cDddDCMaObI7uTZ8bp41UcequfIS?= =?us-ascii?Q?1to1Ok3wrbloFFKfcvNYItrZ5ls1y4A2FAJ8QnhW6fBYVM7Va/BCX025FBdR?= =?us-ascii?Q?iGaLq4syYeRhDVUWxHWyf3lLJpziBHv4hmthrVwYGgnj0UqM+C/W5HVCLc2O?= =?us-ascii?Q?d5SgAOLShH3Hnb21X+AOFphuFtxkdOWndZrv2GoKJObFY1/o6nFIhzMUTZeu?= =?us-ascii?Q?AprpBRmvdC/M27aXRdX3PItzZ0WjwYtZnlWXYhnY0KkWXxVqnNVY2tR+soNp?= =?us-ascii?Q?g24YYxIQ31BjEMA2HIXRCqm+r6ySXbz9AQx46fjt4kv+v1J8+r1GPI9FFw8x?= =?us-ascii?Q?97n4mjC9BxQ2qO6WIacOifoRwXUzMVqOZMl5LY2bTbnqc54ya+aJHKoowqU6?= =?us-ascii?Q?oHnYQGP597ekO1IAiVNJv9RZMFVU5eAsG6uKCBT9xP0L/OS3IMWW2aD7xyyZ?= =?us-ascii?Q?Az8qWzTa946YnrhoksnkIoXmGe/LegRW2cdUs0FxfHoz9vhgqoNl9eSrDQap?= =?us-ascii?Q?DdgCihH8YK4ngMXqF/fqoULV0t1HKkXvYkuYMryL01hWt0foxprzCeVApIDe?= =?us-ascii?Q?fKUZpAKLbT3CGsb6QLjN22Q6IuzR1ThqHOogsEnF7YaH66D4UiJBK4WiBqam?= =?us-ascii?Q?GYI/BkIaY3leYak7PmVfj35F1cS8hgZNLEnW7z+PfXnICY5ap15f9DsSF7io?= =?us-ascii?Q?PhDYmFn8oiYgTryfxQL0HUbYargnasTyKu7pgo+CeoL5V9UqNUMtu5NuFO+9?= =?us-ascii?Q?laaaIHfvqDP2W2uCQmfQhzOifn+vfUpHdzMyjlcn5Y49BLy2ddQg945Cpgop?= =?us-ascii?Q?7U9kJ7LHb69H3+BdrNbS1vYzmIsDSRlW/58HwHH4tWyv/CZeN8atMkKrFgOw?= =?us-ascii?Q?qQJRnv7vqU2SBEAkwRBjJ6dR?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1594.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8af95410-2074-45c3-2462-08d8d3a59794 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2021 00:39:03.8258 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cO2caXdMIE6UDpHeLLztmJ/4egMJX6nnwXjIkG7Qcoz0CTiHVOfqGflg4BGLUo1aU8qVqcDF47qaZnRx5uJt2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4345 Return-Path: yuwei.chen@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Pierre, There seems already have a Bugzilla link for this issue: https://bugzilla.= tianocore.org/show_bug.cgi?id=3D3094 And a personally concern: Some of the current codes still use "_***_H_", s= uch as " __PEI_APRIORI_FILE_NAME_H__ ". If the ECC check only support the c= oding standard you mentioned, will we need to change all these codes? Or sh= ould ECC check support the origin format too? Regards, Yuwei (Christine)=20 > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of > PierreGondois > Sent: Tuesday, February 16, 2021 5:29 PM > To: devel@edk2.groups.io; Feng, Bob C ; > gaoliming@byosoft.com.cn; rebecca@nuviainc.com; > sami.mujawar@arm.com > Cc: leif@nuviainc.com > Subject: [edk2-devel] [PATCH v2 1/1] BaseTools: Align include guards pol= icy >=20 > From: Pierre Gondois >=20 > The EDK II C Coding Standards Specification states that: > "Names starting with one or two underscores, such as > _MACRO_GUARD_FILE_NAME_H_, must not be used. They are reserved for > compiler implementation." [1] >=20 > The Ecc tool currently checks that the include guard end with a trailing > underscore. Thus, the check and the error message should both be modifie= d. >=20 > The new check forces having one sole trailing underscore character, as t= he > example in the specification shows: > "FILE_NAME_H_" [1] > This would allow to have more consistency. >=20 > [1] Section 5.3.5 "All include file contents must be protected by a #inc= lude > guard": > https://edk2-docs.gitbook.io/ > edk-ii-c-coding-standards-specification/ > 5_source_files/53_include_files >=20 > Signed-off-by: Pierre Gondois > Reviewed-by: Sami Mujawar > --- > The changes can be seen at: > https://github.com/PierreARM/edk2/tree/1619_Ecc_BaseTools_include_gua > rds_v2 >=20 > Notes: > v2: > - Place new copyright on top of old ones [Rebecca] >=20 > BaseTools/Source/Python/Ecc/Check.py | 3 ++- > BaseTools/Source/Python/Ecc/EccToolError.py | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/Ecc/Check.py > b/BaseTools/Source/Python/Ecc/Check.py > index 6087abfa4d8d..7a012617fd35 100644 > --- a/BaseTools/Source/Python/Ecc/Check.py > +++ b/BaseTools/Source/Python/Ecc/Check.py > @@ -1,6 +1,7 @@ > ## @file > # This file is used to define checkpoints used by ECC tool # > +# Copyright (c) 2021, Arm Limited. All rights reserved.
> # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved. # > SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -1438,7 +1439,7 @@ > class Check(object): > RecordSet =3D EccGlobalData.gDb.TblFile.Exec(SqlCommand) > for Record in RecordSet: > Name =3D Record[1].replace('#ifndef', '').strip() > - if Name[-1] !=3D '_': > + if Name[0] =3D=3D '_' or Name[-1] !=3D '_' or Name[-2] = = =3D=3D '_': > if not > EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHE > CK_IFNDEF_STATEMENT, Name): >=20 > EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK > _IFNDEF_STATEMENT, OtherMsg=3D"The #ifndef name [%s] does not follow > the rules" % (Name), BelongsToTable=3DFileTable, BelongsToItem=3DRecord[= 0]) >=20 > diff --git a/BaseTools/Source/Python/Ecc/EccToolError.py > b/BaseTools/Source/Python/Ecc/EccToolError.py > index 0ff3b42674d4..d97bf7948ce8 100644 > --- a/BaseTools/Source/Python/Ecc/EccToolError.py > +++ b/BaseTools/Source/Python/Ecc/EccToolError.py > @@ -1,6 +1,7 @@ > ## @file > # Standardized Error Handling infrastructures. > # > +# Copyright (c) 2021, Arm Limited. All rights reserved.
> # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved. # > SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -161,7 +162,7 @@ > gEccErrorMessage =3D { > ERROR_NAMING_CONVENTION_CHECK_ALL : "", > ERROR_NAMING_CONVENTION_CHECK_DEFINE_STATEMENT : "Only > capital letters are allowed to be used for #define declarations", > ERROR_NAMING_CONVENTION_CHECK_TYPEDEF_STATEMENT : "Only > capital letters are allowed to be used for typedef declarations", > - ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT : "The > #ifndef at the start of an include file should use both prefix and postf= ix > underscore characters, '_'", > + ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT : "The > #ifndef at > + the start of an include file should have one postfix underscore, and > + no prefix underscore character '_'", > ERROR_NAMING_CONVENTION_CHECK_PATH_NAME : """Path name > does not follow the rules: 1. First character should be upper case 2. Mu= st > contain lower case characters 3. No white space characters""", > ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME : """Variable > name does not follow the rules: 1. First character should be upper case = 2. > Must contain lower case characters 3. No white space characters 4. Globa= l > variable name must start with a 'g'""", > ERROR_NAMING_CONVENTION_CHECK_FUNCTION_NAME : """Function > name does not follow the rules: 1. First character should be upper case = 2. > Must contain lower case characters 3. No white space characters""", > -- > 2.17.1 >=20 >=20 >=20 >=20 >=20