edk2/BaseTools/Source/Python
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
..
AmlToC BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
AutoGen BaseTools/build.py: Use full source file path for dependency generation 2026-07-17 10:54:11 +00:00
BPDG BaseTools: Remove unused import 2025-07-01 09:51:38 +08:00
build BaseTools/build: Add defines for Windows build environments 2026-01-06 04:44:08 +00:00
Capsule BaseTools/Capsule: Prevent to Read the STDOUT Content as Signature 2026-05-26 06:51:14 +00:00
Common BaseTools: Reject Inline Comments in tools_def 2026-04-21 00:18:43 +00:00
CommonDataClass BaseTools: Fix MODEL_IDENTIFIER_MACRO_PROGMA typo 2026-06-26 02:18:38 +00:00
Ecc BaseTools/Ecc: Add check for traditional include guards 2026-06-26 02:18:38 +00:00
Eot BaseTools: Fix MODEL_IDENTIFIER_MACRO_PROGMA typo 2026-06-26 02:18:38 +00:00
FirmwareStorageFormat BaseTools: Enable FMMT Rebase function 2025-11-23 23:30:49 +00:00
FMMT BaseTools: fix mdlint issues 2026-03-04 22:02:33 +00:00
GenFds BaseTools/GenFds: Print INF name on Depex eval failure 2026-07-09 09:58:04 +00:00
GenPatchPcdTable BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
PatchPcdValue BaseTools: Decouple AutoGen Objects 2019-08-09 23:15:52 +08:00
Pkcs7Sign BaseTools: fix mdlint issues 2026-03-04 22:02:33 +00:00
Rsa2048Sha256Sign BaseTools:Updata the output encoding of the Popen function 2019-08-01 15:36:48 +08:00
Split BaseTools: use shutil.copyfile instead shutil.copy2 2021-08-02 03:52:15 +00:00
Table BaseTools: Table: Remove unnecessary code 2025-07-01 09:51:38 +08:00
TargetTool BaseTools: Remove ARM32 Support 2025-09-25 22:04:10 +00:00
tests/Split BaseTools: fix the split output files root dir 2021-02-07 01:46:18 +00:00
Trim BaseTools/Trim.py: Strip "#pragma once" from inlined ASL content 2026-07-17 21:50:16 +00:00
UPT BaseTools: Fix MODEL_IDENTIFIER_MACRO_PROGMA typo 2026-06-26 02:18:38 +00:00
Workspace BaseTools: Fix Clang -Wtautological-overlap-compare in PcdValueInit.c 2026-08-01 16:17:54 +00:00
basetool_tiano_python_path_env.yaml BaseTools: Add YAML files with path env and tool extdeps 2019-11-11 13:01:53 -08:00
GNUmakefile BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Makefile BaseTools: strip trailing whitespace 2019-10-04 11:18:22 +01:00
sitecustomize.py BaseTools: Do not call sys.setdefaultencoding with python 3 2019-10-23 14:25:23 +08:00