Branch: refs/heads/master
Home: https://github.com/tianocore/edk2
Commit: d45f882a1bf077f7e8e828fc9dfb14f3187142c1
https://github.com/tianocore/edk2/commit/d45f882a1bf077f7e8e828fc9dfb14f3187142c1
Author: Phil Noh <[email protected]>
Date: 2026-08-01 (Sat, 01 Aug 2026)
Changed paths:
M BaseTools/Source/Python/Workspace/DscBuildData.py
Log Message:
-----------
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 <[email protected]>
To unsubscribe from these emails, change your notification settings at
https://github.com/tianocore/edk2/settings/notifications
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits