]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools:ECC need to handle lower case 'static'
authorFan, ZhijuX <zhijux.fan@intel.com>
Wed, 4 Sep 2019 09:54:12 +0000 (17:54 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Mon, 9 Sep 2019 03:14:42 +0000 (11:14 +0800)
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1778

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 <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/Python/Ecc/Check.py
BaseTools/Source/Python/Ecc/Configuration.py
BaseTools/Source/Python/Ecc/EccToolError.py
BaseTools/Source/Python/Ecc/c.py

index 86bb8562babc01fc7bf25f412a94a915c6edcf99..218081860993e68b063f5fc7674fbb5cc430a956 100644 (file)
@@ -441,7 +441,7 @@ class Check(object):
         self.DeclCheckUnionType()\r
 \r
 \r
-    # Check whether no use of int, unsigned, char, void, static, long in any .c, .h or .asl files.\r
+    # Check whether no use of int, unsigned, char, void, long in any .c, .h or .asl files.\r
     def DeclCheckNoUseCType(self):\r
         if EccGlobalData.gConfig.DeclarationDataTypeCheckNoUseCType == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking Declaration No use C type ...")\r
index 57ae932ed2595423369734feb2fad1f07e8f30a6..9d9feaca5eb6a01908e5d1d87fca10fa72dbdccb 100644 (file)
@@ -256,7 +256,7 @@ class Configuration(object):
         ## Declarations and Data Types Checking\r
         self.DeclarationDataTypeCheckAll = 0\r
 \r
-        # Check whether no use of int, unsigned, char, void, static, long in any .c, .h or .asl files.\r
+        # Check whether no use of int, unsigned, char, void, long in any .c, .h or .asl files.\r
         self.DeclarationDataTypeCheckNoUseCType = 1\r
         # Check whether the modifiers IN, OUT, OPTIONAL, and UNALIGNED are used only to qualify arguments to a function and should not appear in a data type declaration\r
         self.DeclarationDataTypeCheckInOutModifier = 1\r
index 4b1bef6a3ec3f69f099273c5ed64289e78de6a51..0ff3b42674d4ad4ced17a3d3c2b0aff7025573a0 100644 (file)
@@ -149,7 +149,7 @@ gEccErrorMessage = {
     ERROR_INCLUDE_FILE_CHECK_NAME : "No permission for the include file with same names",\r
 \r
     ERROR_DECLARATION_DATA_TYPE_CHECK_ALL : "",\r
-    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",\r
+    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",\r
     ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MODIFIER : """The modifiers IN, OUT, OPTIONAL, and UNALIGNED should be used only to qualify arguments to a function and should not appear in a data type declaration""",\r
     ERROR_DECLARATION_DATA_TYPE_CHECK_EFI_API_MODIFIER : "The EFIAPI modifier should be used at the entry of drivers, events, and member functions of protocols",\r
     ERROR_DECLARATION_DATA_TYPE_CHECK_ENUMERATED_TYPE : "Enumerated Type should have a 'typedef' and the name must be in capital letters",\r
index a67ebb0630c1c1d0dd8c89dde620588112b24bfe..a30122a45f81e79f00552c0d099bcc664fde06ed 100644 (file)
@@ -1859,7 +1859,7 @@ def CheckDeclNoUseCType(FullFileName):
                        where Model = %d\r
                    """ % (FileTable, DataClass.MODEL_IDENTIFIER_VARIABLE)\r
     ResultSet = Db.TblFile.Exec(SqlStatement)\r
-    CTypeTuple = ('int', 'unsigned', 'char', 'void', 'static', 'long')\r
+    CTypeTuple = ('int', 'unsigned', 'char', 'void', 'long')\r
     for Result in ResultSet:\r
         for Type in CTypeTuple:\r
             if PatternInModifier(Result[0], Type):\r