From: Vladimir Serbinenko Date: Fri, 25 Aug 2023 11:37:43 +0000 (+0200) Subject: kern/mm: Use %x and cast for displaying sizeof() X-Git-Tag: grub-2.12~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d2aa7ee0158ad1218fe8ec4ba96fe04ff21486b;p=thirdparty%2Fgrub.git kern/mm: Use %x and cast for displaying sizeof() There is some variance in how compiler treats 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 Reviewed-by: Daniel Kiper --- diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c index 792ab0a83..027a25cd1 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->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) {