BaseTools/ECC: Fix an identification issue of typedef function.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Hess Chen
2018-10-16 16:21:48 +08:00
committed by Yonghong Zhu
parent 33a211d009
commit 3a244b8db4
2 changed files with 17 additions and 3 deletions

View File

@ -2144,7 +2144,7 @@ def CheckBooleanValueComparison(FullFileName):
PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_BOOLEAN_VALUE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])
def CheckHeaderFileData(FullFileName):
def CheckHeaderFileData(FullFileName, AllTypedefFun=[]):
ErrorMsgList = []
FileID = GetTableID(FullFileName, ErrorMsgList)
@ -2160,7 +2160,11 @@ def CheckHeaderFileData(FullFileName):
ResultSet = Db.TblFile.Exec(SqlStatement)
for Result in ResultSet:
if not Result[1].startswith('extern'):
PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_DATA, 'Variable definition appears in header file', FileTable, Result[0])
for Item in AllTypedefFun:
if '(%s)' % Result[1] in Item:
break
else:
PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_DATA, 'Variable definition appears in header file', FileTable, Result[0])
SqlStatement = """ select ID
from Function