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
Signed-off-by: Vladimir Serbinenko <phco...@gmail.com>
From 3e738cb99eb15f2cfa9d5c7dc887d2869143a69e Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko <phco...@gmail.com> Date: Fri, 25 Aug 2023 13:37:43 +0200 Subject: [PATCH 14/14] 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 Signed-off-by: Vladimir Serbinenko <phco...@gmail.com> --- 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.39.2
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel