summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2020-12-10 13:47:50 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-12-22 01:26:10 +0000
commit6899e6789a7f978175fc9cafec3459e4f4f8e1dc (patch)
tree1227341ff837248e4c4f71442d8eb0f7bdfdce07 /BaseTools
parentb23c5b9722b50d598f861c057122e91fa3e6b3fe (diff)
downloadedk2-6899e6789a7f978175fc9cafec3459e4f4f8e1dc.tar.gz
edk2-6899e6789a7f978175fc9cafec3459e4f4f8e1dc.tar.bz2
edk2-6899e6789a7f978175fc9cafec3459e4f4f8e1dc.zip
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>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/Ecc/c.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc/c.py
index db686df0db..4a82e5e760 100644
--- a/BaseTools/Source/Python/Ecc/c.py
+++ b/BaseTools/Source/Python/Ecc/c.py
@@ -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):