<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/BaseTools/Source/Python/Ecc, branch master</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2026-06-26T02:18:38+00:00</updated>
<entry>
<title>BaseTools/Ecc: Add check for traditional include guards</title>
<updated>2026-06-26T02:18:38+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2026-06-18T15:43:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=35b5565764ea7be7b2cd69626bf9ae264a4fecf8'/>
<id>urn:sha1:35b5565764ea7be7b2cd69626bf9ae264a4fecf8</id>
<content type='text'>
Adds a new ECC check, `IncludeFileCheckPragmaOnce` (error code 6006),
that flags header files using a traditional `#ifndef`/`#define`
include guard and recommends `#pragma once` instead.

A guard is detected when a '#ifndef NAME' is immediately followed by a
valueless '#define NAME' using the same macro name. Feature macros
such as '#define FOO 1' and files already using '#pragma once' are not
flagged.

The check reports against the parsed preprocessor directive rows in
the identifier tables rather than the File table. Those rows carry the
actual source line number, whereas File-level findings resolve to
"line 1" in the report. This gives an accurate line number, to the
EccCheck CI plugin, so it can reconcile findings with the changed line
ranges of a commit.

It uses the binary extension list and the exception list, consistent
with the other include file checks.

Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Fix MODEL_IDENTIFIER_MACRO_PROGMA typo</title>
<updated>2026-06-26T02:18:38+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2026-06-18T15:48:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=4b27e8e20b7e67e76cab6593f21b8adb894bcfcc'/>
<id>urn:sha1:4b27e8e20b7e67e76cab6593f21b8adb894bcfcc</id>
<content type='text'>
Fixes typo in the constant name.

Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Ecc: Update to ANTLR 4.13.2</title>
<updated>2026-04-08T22:23:35+00:00</updated>
<author>
<name>Oliver Smith-Denny</name>
<email>osde@microsoft.com</email>
</author>
<published>2026-03-19T22:23:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=35c03c1c9f53af6ff9bbc5f8748eb30614259687'/>
<id>urn:sha1:35c03c1c9f53af6ff9bbc5f8748eb30614259687</id>
<content type='text'>
ANTLR 4.9 is broken in python 3.13 because
it uses a library in the autogenerated files
that is removed.

This updates to 4.13.2 and also updates the autogen
files, which contain support for python 3.13 as well
as backwards compat.

Signed-off-by: Oliver Smith-Denny &lt;osde@microsoft.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Ecc: Use SPDX in AutoGen Template</title>
<updated>2026-04-08T22:23:35+00:00</updated>
<author>
<name>Oliver Smith-Denny</name>
<email>osde@microsoft.com</email>
</author>
<published>2026-04-03T16:28:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=9b676f7cc2d13c0666ef47010bfb093768896195'/>
<id>urn:sha1:9b676f7cc2d13c0666ef47010bfb093768896195</id>
<content type='text'>
The ANTLR autogen files are currently created
without an SPDX identifer. Add the BSD-2-Clause-Patent
ID.

While here, correct the command to do the autogeneration
by using the right filename.

Signed-off-by: Oliver Smith-Denny &lt;osde@microsoft.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Ecc: Drop ANTLR 3 Support</title>
<updated>2026-04-08T22:23:35+00:00</updated>
<author>
<name>Oliver Smith-Denny</name>
<email>osde@microsoft.com</email>
</author>
<published>2026-03-19T22:20:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=229600664e264072bbca368c7cbbe26223af16a4'/>
<id>urn:sha1:229600664e264072bbca368c7cbbe26223af16a4</id>
<content type='text'>
BaseTools hasn't been using ANTLR3 since at
least 2019. Drop the files.

Signed-off-by: Oliver Smith-Denny &lt;osde@microsoft.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/Ecc: Apply CParser4 ANTLR 4.9 regeneration whitespace changes</title>
<updated>2026-02-27T23:18:15+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2026-02-26T20:59:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=ba8010bc6c04af4932f69acd1cbf6afa2a423a91'/>
<id>urn:sha1:ba8010bc6c04af4932f69acd1cbf6afa2a423a91</id>
<content type='text'>
Whitespace-only changes produced by the ANTLR 4.9 code generator.

Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/Ecc: Regenerate CParser4 files with ANTLR 4.9</title>
<updated>2026-02-27T23:18:15+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2026-02-26T20:58:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=ae240285120b7249a8ce1cae7fa49c7341583c3b'/>
<id>urn:sha1:ae240285120b7249a8ce1cae7fa49c7341583c3b</id>
<content type='text'>
The CParser4 Python parser files (CLexer.py, CParser.py, CListener.py)
were generated 7 years ago with ANTLR 4.7.1.

Meanwhile, pip-requirements.txt pins antlr4-python3-runtime to version
4.9 in commit 4a7dd50, but the files were patched, not fully
regenerated. This version mismatch produced two failures when running
EccMain.py against non-trivial C code:

1. A runtime warning on every file parsed:
   "ANTLR runtime and generated code versions disagree: 4.9!=4.7.1"

2. A crash when parsing complex C constructs that exercise the
   struct/union definition rule in CParser.py:

   TypeError: '&lt;' not supported between instances of 'tuple' and 'int'

   This occurs in antlr4/BufferedTokenStream.py getText() because the
   4.9 runtime changed the expected argument types for that method,
   and the 4.7.1-generated parser was passing a tuple where an int is
   now required.

This change regenerates the CParser4 files with ANTLR 4.9 to resolve
the version mismatch.

Steps used to regenerate the files:

  1. Download the ANTLR 4.9 complete tool JAR:
     - `https://www.antlr.org/download/antlr-4.9-complete.jar`

  2. Generate Python3 parser files from the grammar:

     ```
     java -jar antlr-4.9-complete.jar `
       -Dlanguage=Python3 -visitor `
       -o BaseTools/Source/Python/Ecc/CParser4_new `
       BaseTools/Source/Python/Ecc/CParser4/C.g4
     ```

Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/Ecc: Remove #ifndef include guard checks</title>
<updated>2026-02-23T21:01:28+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2026-02-17T16:10:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=5ce48c03cbb428bac53e31973e844b07730b9ca8'/>
<id>urn:sha1:5ce48c03cbb428bac53e31973e844b07730b9ca8</id>
<content type='text'>
The codebase has moved from traditional `#ifndef` include guards to
`#pragma once`. Remove the ECC checks that validated include guard
presence and naming conventions since they are no longer applicable.

The following checks are removed:

- IncludeFileCheckIfndefStatement: Verified all header file contents
  were guarded by a `#ifndef` statement, that the `#ifndef` was the
  first line of code after the file header comment, and that the
  `#endif` appeared on the last line.

- NamingConventionCheckIfndefStatement: Verified that the `#ifndef`
  guard name at the start of an include file used a postfix underscore
  and no prefix underscore character.

Also removed related error codes and configuration settings that were
specific to these checks.

Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Remove ARM32 Support</title>
<updated>2025-09-25T22:04:10+00:00</updated>
<author>
<name>Oliver Smith-Denny</name>
<email>osde@microsoft.com</email>
</author>
<published>2025-09-17T21:24:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=2ff173af128e707867c6409f2e4ca308c255ca32'/>
<id>urn:sha1:2ff173af128e707867c6409f2e4ca308c255ca32</id>
<content type='text'>
edk2 is dropping support for the ARM32 architecture. This
commit removes ARM32 code from BaseTools.

Signed-off-by: Oliver Smith-Denny &lt;osde@microsoft.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Ecc: Remove unnecessary code</title>
<updated>2025-07-01T01:51:38+00:00</updated>
<author>
<name>Pierre Gondois</name>
<email>pierre.gondois@arm.com</email>
</author>
<published>2025-04-30T12:35:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=7402bd06cfa88a93a416a1edff7e7f9283ee18ed'/>
<id>urn:sha1:7402bd06cfa88a93a416a1edff7e7f9283ee18ed</id>
<content type='text'>
Running the vulture tool on the Ecc folder gave the following
report. Remove the unnecessary code.

- Ecc/c.py:52:
  unused function 'GetConfig' (60% confidence)
- Ecc/c.py:484:
  unused function 'GetFileModificationTimeFromDB' (60% confidence)
- Ecc/CodeFragmentCollector.py:77:
  unused attribute '__Token' (60% confidence)
- Ecc/CodeFragmentCollector.py:78:
  unused attribute '__SkippedChars' (60% confidence)
- Ecc/CodeFragmentCollector.py:109:
  unused method '__EndOfLine' (60% confidence)
- Ecc/CodeFragmentCollector.py:134:
  unused method '__UndoOneChar' (60% confidence)
- Ecc/CodeFragmentCollector.py:221:
  unused method '__InsertComma' (60% confidence)
- Ecc/CodeFragmentCollector.py:539:
  unused method 'PrintFragments' (60% confidence)
- Ecc/Database.py:81:
  unused attribute 'text_factory' (60% confidence)
- Ecc/Database.py:214:
  unused method 'UpdateIdentifierBelongsToFunction_disabled'
  (60% confidence)
- Ecc/MetaFileWorkspace/MetaDataTable.py:142:
  unused method 'IsIntegral' (60% confidence)
- Ecc/MetaFileWorkspace/MetaDataTable.py:205:
  unused method 'GetCrossIndex' (60% confidence)
- Ecc/Xml/XmlRoutines.py:145:
  unused function 'XmlElementData' (60% confidence)
- Ecc/Xml/XmlRoutines.py:162:
  unused function 'XmlElementList' (60% confidence)
- Ecc/Xml/XmlRoutines.py:192:
  unused function 'XmlNodeName' (60% confidence)

Signed-off-by: Pierre Gondois &lt;pierre.gondois@arm.com&gt;
</content>
</entry>
</feed>
