diff options
| author | Phil Noh <Phil.Noh@amd.com> | 2026-07-21 23:02:20 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-08-01 19:17:54 +0300 |
| commit | d45f882a1bf077f7e8e828fc9dfb14f3187142c1 (patch) | |
| tree | 44f4dc1484d3014ae6ab355afc99657a9eb31bba /BaseTools/Source/Python/Workspace/MetaFileParser.py | |
| parent | 6c4a9a7659bb918c443e5aaf927c4bc178053eb1 (diff) | |
| download | edk2-d45f882a1bf077f7e8e828fc9dfb14f3187142c1.tar.xz | |
BaseTools: Fix Clang -Wtautological-overlap-compare in PcdValueInit.c
For each structured-PCD field copied via memcpy, DscBuildData.py
emits the clamp expression, '(FieldSize > 0 && FieldSize < ValueSize) ?
FieldSize : ValueSize'. When ValueSize == 1 and FieldSize is unsigned,
it reduces to (FieldSize > 0 && FieldSize < 1) - always-false comparison.
Clang flags it under -Wtautological-overlap-compare, and because
PcdValueInit builds with -Werror, autogen fails and the build aborts with
'PcdValueInit.c: error: overlapping comparisons always evaluate to false
[-Werror,-Wtautological-overlap-compare]'. This is specific to Clang host.
To fix it, this update changes '<' to '<=' at all five generator sites in
DscBuildData.py (GenerateDefaultValueAssignFunction,
GenerateInitValueFunction, GenerateCommandLineValue,
GenerateModuleScopeValue, GenerateFdfValue). Behavior is unchanged:
both branches copy the same byte count when FieldSize == ValueSize.
GCC and MSVC builds are unaffected.
Signed-off-by: Phil Noh <Phil.Noh@amd.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace/MetaFileParser.py')
0 files changed, 0 insertions, 0 deletions
