edk2/BaseTools/Source/Python/Workspace
Phil Noh d45f882a1b 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>
2026-08-01 16:17:54 +00:00
..
__init__.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
BuildClassObject.py BaseTools: WorkSpace: Remove unnecessary code 2025-07-01 09:51:38 +08:00
DecBuildData.py BaseTools: Enable the flag to treat dynamic pcd as dynamicEx 2021-07-12 07:40:07 +00:00
DscBuildData.py BaseTools: Fix Clang -Wtautological-overlap-compare in PcdValueInit.c 2026-08-01 16:17:54 +00:00
InfBuildData.py BaseTools: Remove DXE_SAL_DRIVER 2025-10-30 10:00:32 +00:00
MetaDataTable.py BaseTools: WorkSpace: Remove unnecessary code 2025-07-01 09:51:38 +08:00
MetaFileCommentParser.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
MetaFileParser.py BaseTools/Build: Fix arch macro expansion scope in DSC parser 2026-06-23 02:21:25 +00:00
MetaFileTable.py BaseTools: WorkSpace: Remove unnecessary code 2025-07-01 09:51:38 +08:00
WorkspaceCommon.py BaseTools: Dump library dependency chain on build failure 2025-04-08 08:40:49 +00:00
WorkspaceDatabase.py BaseTools: WorkSpace: Remove unnecessary code 2025-07-01 09:51:38 +08:00