From 16e889308c335aaa4c54ba0724b655cffa2ed850 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phco...@gmail.com>
Date: Fri, 25 Aug 2023 13:37:43 +0200
Subject: [PATCH 13/13] mm: Use %x and a case for displaying sizeof.

There is some variance in how compiler treat sizeof especially on
32-bit platforms where it can be naturally either int or long.
Explicit cast solves the issue
---
 grub-core/kern/mm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c
index 792ab0a83..2ba0c184e 100644
--- a/grub-core/kern/mm.c
+++ b/grub-core/kern/mm.c
@@ -238,8 +238,8 @@ grub_mm_init_region (void *addr, grub_size_t size)
        *   |<q region>|-q->post_size-|----size-----|
        */
       grub_dprintf ("regions", "Can we extend into region below?"
-                    " %p + %" PRIxGRUB_SIZE " + %" PRIxGRUB_SIZE " + %" PRIxGRUB_SIZE " ?=? %p\n",
-                    (grub_uint8_t *) q, sizeof(*q), q->size, q->post_size, (grub_uint8_t *) addr);
+                    " %p + %x + %" PRIxGRUB_SIZE " + %" PRIxGRUB_SIZE " ?=? %p\n",
+                    (grub_uint8_t *) q, (int) sizeof(*q), q->size, q->post_size, (grub_uint8_t *) addr);
       if ((grub_uint8_t *) q + sizeof (*q) + q->size + q->post_size ==
 	  (grub_uint8_t *) addr)
 	{
-- 
2.42.0

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to