1 Star 0 Fork 50

Meredith/grub2

forked from src-anolis-os/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0267-Fix-PRIxGRUB_EFI_STATUS-definition.patch 1.90 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2022-04-13 15:15 . update to grub2-2.02-120.el8.src.rpm
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Thu, 28 Nov 2019 13:23:59 +0100
Subject: [PATCH] Fix PRIxGRUB_EFI_STATUS definition
The type specifiers were wrongly defined when GRUB_CPU_SIZEOF_VOID_P != 8
since in that case the grub_efi_status_t is a grub_int32_t typedef. This
leads to the following covscan warnings:
grub-2.02/include/grub/dl.h:29: included_from: Included from here.
grub-2.02/include/grub/efi/efi.h:24: included_from: Included from here.
grub-2.02/grub-core/kern/efi/tpm.c:4: included_from: Included from here.
grub-2.02/grub-core/kern/efi/tpm.c: scope_hint: In function 'grub_tpm_dprintf'
grub-2.02/grub-core/kern/efi/tpm.c:170:26: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'grub_efi_status_t' {aka 'int'} [-Wformat=]
grub-2.02/include/grub/misc.h:38:88: note: in definition of macro 'grub_dprintf'
Related: rhbz#1761811
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
include/grub/efi/api.h | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
index b337e1a19..6c440c613 100644
--- a/include/grub/efi/api.h
+++ b/include/grub/efi/api.h
@@ -539,11 +539,16 @@ typedef grub_uint16_t grub_efi_char16_t;
typedef grub_efi_intn_t grub_efi_status_t;
/* Make grub_efi_status_t reasonably printable. */
#if GRUB_CPU_SIZEOF_VOID_P == 8
-#define PRIxGRUB_EFI_STATUS "lx"
-#define PRIdGRUB_EFI_STATUS "ld"
+# if GRUB_CPU_SIZEOF_LONG == 8
+# define PRIxGRUB_EFI_STATUS "lx"
+# define PRIdGRUB_EFI_STATUS "ld"
+# else
+# define PRIxGRUB_EFI_STATUS "llx"
+# define PRIdGRUB_EFI_STATUS "lld"
+# endif
#else
-#define PRIxGRUB_EFI_STATUS "llx"
-#define PRIdGRUB_EFI_STATUS "lld"
+# define PRIxGRUB_EFI_STATUS "x"
+# define PRIdGRUB_EFI_STATUS "d"
#endif
#define GRUB_EFI_ERROR_CODE(value) \
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yueeranna/grub2.git
git@gitee.com:yueeranna/grub2.git
yueeranna
grub2
grub2
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385