X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FEcc%2Fc.py;h=39a9d8ac363a8abeb1cbe060010ad0c98b6a633c;hp=d7b95984385a2e2155968dd7ca123c0a63e3ec14;hb=dbc85eb993439a7006bb20091c1cc6de43d19e80;hpb=f8895c2ad4fe0191732aa376333eaf49649e3760 diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc/c.py index d7b9598438..39a9d8ac36 100644 --- a/BaseTools/Source/Python/Ecc/c.py +++ b/BaseTools/Source/Python/Ecc/c.py @@ -1,7 +1,7 @@ ## @file # This file is used to be the c coding style checking of ECC tool # -# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -271,7 +271,7 @@ def GetIdentifierList(): def StripNonAlnumChars(Str): StrippedStr = '' for Char in Str: - if Char.isalnum(): + if Char.isalnum() or Char == '_': StrippedStr += Char return StrippedStr @@ -1858,7 +1858,13 @@ def CheckDeclNoUseCType(FullFileName): for Result in ResultSet: for Type in CTypeTuple: if PatternInModifier(Result[0], Type): - PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE, 'Variable type %s' % Type, FileTable, Result[2]) + if EccGlobalData.gException.IsException(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE, + Result[0] + ' ' + Result[1]): + continue + PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE, + 'Invalid variable type (%s) in definition [%s]' % (Type, Result[0] + ' ' + Result[1]), + FileTable, + Result[2]) break SqlStatement = """ select Modifier, Name, ID, Value