From 6c061c4715325494b8b25453158166f9032e0335 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Tue, 9 Jul 2024 19:10:26 -0400 Subject: BaseTools/Ecc: Allow `static` as a modifier Currently, `STATIC` is allowed as a function modifier but `static` results in the below ECC errors: ``` *Error code: 5001 *Return type of a function should exist and in the first line *file: D:\src\edk2\Build\.pytool\Plugin\EccCheck\MdePkg\Library\UefiDebugLibDebugPortProtocol\DebugLibConstructor.c *Line number: 37 *[UefiDebugLibDebugPortProtocolExitBootServicesCallback] Return Type should appear at the start of line EFI coding style error *Error code: 5002 *Any optional functional modifiers should exist and next to the return type *file: D:\src\edk2\Build\.pytool\Plugin\EccCheck\MdePkg\Library\UefiDebugLibDebugPortProtocol\DebugLibConstructor.c *Line number: 37 ``` This is because `GetDataTypeFromModifier()` will return both `static` and the return type (e.g. `VOID`) whereas for a modifier in the list (e.g. `STATIC`) it will return only the return type allowing logic in Ecc/c.py to process the modifier and return type with current logic. Signed-off-by: Michael Kubacki --- BaseTools/Source/Python/Ecc/config.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Ecc/config.ini b/BaseTools/Source/Python/Ecc/config.ini index 5529d0f..6edf897 100644 --- a/BaseTools/Source/Python/Ecc/config.ini +++ b/BaseTools/Source/Python/Ecc/config.ini @@ -35,7 +35,7 @@ AutoCorrect = 1 # # List customized Modifer here, split with ',' # -ModifierList = IN, OUT, OPTIONAL, UNALIGNED, EFI_RUNTIMESERVICE, EFI_BOOTSERVICE, EFIAPI, TPMINTERNALAPI, STATIC +ModifierList = IN, OUT, OPTIONAL, UNALIGNED, EFI_RUNTIMESERVICE, EFI_BOOTSERVICE, EFIAPI, TPMINTERNALAPI, STATIC, static # # General Checking -- cgit v1.1