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>
self.DeclCheckUnionType()\r
\r
\r
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
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
## Declarations and Data Types Checking\r
self.DeclarationDataTypeCheckAll = 0\r
\r
## 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
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
ERROR_INCLUDE_FILE_CHECK_NAME : "No permission for the include file with same names",\r
\r
ERROR_DECLARATION_DATA_TYPE_CHECK_ALL : "",\r
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
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
where Model = %d\r
""" % (FileTable, DataClass.MODEL_IDENTIFIER_VARIABLE)\r
ResultSet = Db.TblFile.Exec(SqlStatement)\r
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
for Result in ResultSet:\r
for Type in CTypeTuple:\r
if PatternInModifier(Result[0], Type):\r