mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
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 <michael.kubacki@microsoft.com> |
||
|---|---|---|
| .. | ||
| C | ||
| Python | ||