From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: zhijux.fan@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Wed, 04 Sep 2019 02:54:16 -0700 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 02:54:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,465,1559545200"; d="dat'59?scan'59,208,59";a="358044474" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 04 Sep 2019 02:54:15 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Sep 2019 02:54:15 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Sep 2019 02:54:15 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.92]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.146]) with mapi id 14.03.0439.000; Wed, 4 Sep 2019 17:54:13 +0800 From: "Fan, ZhijuX" To: "devel@edk2.groups.io" CC: "Gao, Liming" , "Feng, Bob C" Subject: [PATCH] BaseTools:ECC need to handle lower case 'static' Thread-Topic: [PATCH] BaseTools:ECC need to handle lower case 'static' Thread-Index: AdVjBrNa1Y1V8hFzSS2GNXtModCyeQ== Date: Wed, 4 Sep 2019 09:54:12 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: zhijux.fan@intel.com X-Groupsio-MsgNum: 46776 Content-Type: multipart/mixed; boundary="_000_FAD0D7E0AE0FA54D987F6E72435CAFD50AFB7A2DSHSMSX101ccrcor_" Content-Language: en-US --_000_FAD0D7E0AE0FA54D987F6E72435CAFD50AFB7A2DSHSMSX101ccrcor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1778 We are going to add keyword (lower case) 'static' for functions and global variables which are not referenced outside their current C file. However, the ECC tool only recognizes upper case 'STATIC' at this moment. This will lead to issue reports for new codes that follow the above coding style. This patch is going to handle lower case 'static' Cc: Liming Gao Cc: Bob Feng Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/Ecc/Check.py | 2 +- BaseTools/Source/Python/Ecc/Configuration.py | 2 +- BaseTools/Source/Python/Ecc/EccToolError.py | 2 +- BaseTools/Source/Python/Ecc/c.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/Ecc/Check.py b/BaseTools/Source/Python= /Ecc/Check.py index 86bb8562ba..2180818609 100644 --- a/BaseTools/Source/Python/Ecc/Check.py +++ b/BaseTools/Source/Python/Ecc/Check.py @@ -441,7 +441,7 @@ class Check(object): self.DeclCheckUnionType() =20 =20 - # Check whether no use of int, unsigned, char, void, static, long in a= ny .c, .h or .asl files. + # Check whether no use of int, unsigned, char, void, long in any .c, .= h or .asl files. def DeclCheckNoUseCType(self): if EccGlobalData.gConfig.DeclarationDataTypeCheckNoUseCType =3D=3D= '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll =3D=3D '1' or Ecc= GlobalData.gConfig.CheckAll =3D=3D '1': EdkLogger.quiet("Checking Declaration No use C type ...") diff --git a/BaseTools/Source/Python/Ecc/Configuration.py b/BaseTools/Sourc= e/Python/Ecc/Configuration.py index 57ae932ed2..9d9feaca5e 100644 --- a/BaseTools/Source/Python/Ecc/Configuration.py +++ b/BaseTools/Source/Python/Ecc/Configuration.py @@ -256,7 +256,7 @@ class Configuration(object): ## Declarations and Data Types Checking self.DeclarationDataTypeCheckAll =3D 0 =20 - # Check whether no use of int, unsigned, char, void, static, long = in any .c, .h or .asl files. + # Check whether no use of int, unsigned, char, void, long in any .= c, .h or .asl files. self.DeclarationDataTypeCheckNoUseCType =3D 1 # Check whether the modifiers IN, OUT, OPTIONAL, and UNALIGNED are= used only to qualify arguments to a function and should not appear in a da= ta type declaration self.DeclarationDataTypeCheckInOutModifier =3D 1 diff --git a/BaseTools/Source/Python/Ecc/EccToolError.py b/BaseTools/Source= /Python/Ecc/EccToolError.py index 4b1bef6a3e..0ff3b42674 100644 --- a/BaseTools/Source/Python/Ecc/EccToolError.py +++ b/BaseTools/Source/Python/Ecc/EccToolError.py @@ -149,7 +149,7 @@ gEccErrorMessage =3D { ERROR_INCLUDE_FILE_CHECK_NAME : "No permission for the include file wi= th same names", =20 ERROR_DECLARATION_DATA_TYPE_CHECK_ALL : "", - ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE : "There should be no = use of int, unsigned, char, void, static, long in any .c, .h or .asl files"= , + ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE : "There should be no = use of int, unsigned, char, void, long in any .c, .h or .asl files", ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MODIFIER : """The modifiers I= N, OUT, OPTIONAL, and UNALIGNED should be used only to qualify arguments to= a function and should not appear in a data type declaration""", ERROR_DECLARATION_DATA_TYPE_CHECK_EFI_API_MODIFIER : "The EFIAPI modif= ier should be used at the entry of drivers, events, and member functions of= protocols", ERROR_DECLARATION_DATA_TYPE_CHECK_ENUMERATED_TYPE : "Enumerated Type s= hould have a 'typedef' and the name must be in capital letters", diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc= /c.py index 2a73da7cb8..a99b40a701 100644 --- a/BaseTools/Source/Python/Ecc/c.py +++ b/BaseTools/Source/Python/Ecc/c.py @@ -1859,7 +1859,7 @@ def CheckDeclNoUseCType(FullFileName): where Model =3D %d """ % (FileTable, DataClass.MODEL_IDENTIFIER_VARIABLE) ResultSet =3D Db.TblFile.Exec(SqlStatement) - CTypeTuple =3D ('int', 'unsigned', 'char', 'void', 'static', 'long') + CTypeTuple =3D ('int', 'unsigned', 'char', 'void', 'long') for Result in ResultSet: for Type in CTypeTuple: if PatternInModifier(Result[0], Type): --=20 2.14.1.windows.1 --_000_FAD0D7E0AE0FA54D987F6E72435CAFD50AFB7A2DSHSMSX101ccrcor_ Content-Disposition: attachment; filename="winmail.dat" Content-Transfer-Encoding: base64 Content-Type: application/ms-tnef; name="winmail.dat" eJ8+IkM/AQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEJgAEAIQAAAEUzQUE3MUUx QTdDREQyNDFCNkQ1N0UyRkUyMDI0RkEwAFsHAQ2ABAACAAAAAgACAAEFgAMADgAAAOMHCQAEAAkA NgAMAAMARQEBIIADAA4AAADjBwkABAAJADYADAADAEUBAQiABwAYAAAASVBNLk1pY3Jvc29mdCBN YWlsLk5vdGUAMQgBBIABADkAAABbUEFUQ0hdIEJhc2VUb29sczpFQ0MgbmVlZCB0byBoYW5kbGUg bG93ZXIgY2FzZSAnc3RhdGljJwAfEwELgAEAIQAAAEUzQUE3MUUxQTdDREQyNDFCNkQ1N0UyRkUy MDI0RkEwAFsHAQOQBgBsEgAAMwAAAAIBfwABAAAASAAAADxGQUQwRDdFMEFFMEZBNTREOTg3RjZF NzI0MzVDQUZENTBBRkI3QTJEQFNIU01TWDEwMS5jY3IuY29ycC5pbnRlbC5jb20+AAsAHw4BAAAA AgEJEAEAAADWCAAA0ggAABwUAABMWkZ1SoIUXWEACmZiaWQEAABjY8BwZzEyNTIA/gND8HRleHQB 9wKkA+MCAARjaArAc2V0MCDvB20CgwBQEU0yCoAGtAKAln0KgAjIOwliMTkOwL8JwxZyCjIWcQKA FWIqCbBzCfAEk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