mirror of https://github.com/acidanthera/audk.git
BaseTools/Ecc: Allow init of function static variables
The Ecc tool currently reports the initialization of variables at declaraton if the variable is non-constant and declared in a function. Static variables locally defined in functions should also be allowed to be initialized at declaration. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
parent
b23c5b9722
commit
6899e6789a
|
@ -1560,7 +1560,7 @@ def CheckFuncLayoutLocalVariable(FullFileName):
|
|||
continue
|
||||
|
||||
for Result in ResultSet:
|
||||
if len(Result[1]) > 0 and 'CONST' not in Result[3]:
|
||||
if len(Result[1]) > 0 and 'CONST' not in Result[3] and 'STATIC' not in Result[3]:
|
||||
PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_NO_INIT_OF_VARIABLE, 'Variable Name: %s' % Result[0], FileTable, Result[2])
|
||||
|
||||
def CheckMemberVariableFormat(Name, Value, FileTable, TdId, ModelId):
|
||||
|
|
Loading…
Reference in New Issue