summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Workspace/MetaFileTable.py
diff options
context:
space:
mode:
authorPhil Noh <Phil.Noh@amd.com>2026-07-21 23:02:20 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2026-08-01 19:17:54 +0300
commitd45f882a1bf077f7e8e828fc9dfb14f3187142c1 (patch)
tree44f4dc1484d3014ae6ab355afc99657a9eb31bba /BaseTools/Source/Python/Workspace/MetaFileTable.py
parent6c4a9a7659bb918c443e5aaf927c4bc178053eb1 (diff)
downloadedk2-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/MetaFileTable.py')
0 files changed, 0 insertions, 0 deletions