File edk2-const-correctness.patch of Package edk2
From 9af06ef3cbb052b142f9660c2c01e7aeb401300c Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Mon, 8 Dec 2025 10:28:50 +0100
Subject: [PATCH] BaseTools/EfiRom: fix compiler warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
New warning after updating gcc:
EfiRom.c: In function ‘main’:
EfiRom.c:78:17: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
The assigned value is not used, so fix the warning by just removing it.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
BaseTools/Source/C/EfiRom/EfiRom.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/BaseTools/Source/C/EfiRom/EfiRom.c b/BaseTools/Source/C/EfiRom/EfiRom.c
index fa7bf0e62e..6e903b3504 100644
--- a/BaseTools/Source/C/EfiRom/EfiRom.c
+++ b/BaseTools/Source/C/EfiRom/EfiRom.c
@@ -44,7 +44,6 @@ Returns:
FILE_LIST *FList;
UINT32 TotalSize;
UINT32 Size;
- CHAR8 *Ptr0;
SetUtilityName(UTILITY_NAME);
@@ -75,7 +74,7 @@ Returns:
//
if (mOptions.DumpOption == 1) {
if (mOptions.FileList != NULL) {
- if ((Ptr0 = strstr ((CONST CHAR8 *) mOptions.FileList->FileName, DEFAULT_OUTPUT_EXTENSION)) != NULL) {
+ if (strstr ((CONST CHAR8 *) mOptions.FileList->FileName, DEFAULT_OUTPUT_EXTENSION) != NULL) {
DumpImage (mOptions.FileList);
goto BailOut;
} else {
--
2.51.0