qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[qemu-s390x] [Qemu-devel] [PATCH] hw/s390x: fix clang compilation on 32b


From: Marcel Apfelbaum
Subject: [qemu-s390x] [Qemu-devel] [PATCH] hw/s390x: fix clang compilation on 32bit machines
Date: Sat, 16 Mar 2019 11:50:49 +0200

Configuring QEMU with:
    configure --cc=clang --target-list=s390x-softmmu
And compiling it using a 32 bit machine leads to:
    hw/s390x/s390-virtio-ccw.c:175:27: error: implicit conversion from
      'unsigned long long' to 'ram_addr_t' (aka 'unsigned int') changes value
      from 8796091973632 to 4293918720 [-Werror,-Wconstant-conversion]
        chunk = MIN(size, KVM_SLOT_MAX_BYTES);
              ~ ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

Fix the missmatch by declaring the 'chunk' variable as uint64_t.

Signed-off-by: Marcel Apfelbaum <address@hidden>
---
 hw/s390x/s390-virtio-ccw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index d11069b860..2efa47bc3e 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -161,7 +161,7 @@ static void virtio_ccw_register_hcalls(void)
 static void s390_memory_init(ram_addr_t mem_size)
 {
     MemoryRegion *sysmem = get_system_memory();
-    ram_addr_t chunk, offset = 0;
+    uint64_t chunk, offset = 0;
     unsigned int number = 0;
     gchar *name;
 
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]