[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] Avoid compiler error
From: |
Stefan Weil |
Subject: |
[Qemu-devel] [PATCH] Avoid compiler error |
Date: |
Sat, 10 Apr 2010 09:26:03 +0200 |
A 32 bit cross compilation of x86_64-linux-user raises this error:
CC x86_64-linux-user/exec.o
cc1: warnings being treated as errors
exec.c: In function ‘page_init’:
exec.c:350: error: large integer implicitly truncated to unsigned type
L1_MAP_ADDR_SPACE_BITS == 47, HOST_LONG_BITS == 32,
so the shift operation indeed is problematic.
Limit endaddr to ULONG_MAX in this case.
Cc: Richard Henderson <address@hidden>
Cc: Aurelien Jarno <address@hidden>
Cc: Juergen Lock <address@hidden>
Signed-off-by: Stefan Weil <address@hidden>
---
exec.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/exec.c b/exec.c
index a6d3bad..c80b7f7 100644
--- a/exec.c
+++ b/exec.c
@@ -343,6 +343,8 @@ static void page_init(void)
} else {
#if TARGET_ABI_BITS <= L1_MAP_ADDR_SPACE_BITS
endaddr = ~0ul;
+#elif HOST_LONG_BITS <= L1_MAP_ADDR_SPACE_BITS
+ endaddr = ULONG_MAX;
#else
endaddr = ((abi_ulong)1 << L1_MAP_ADDR_SPACE_BITS) - 1;
#endif
--
1.7.0
- [Qemu-devel] [PATCH] Avoid compiler error,
Stefan Weil <=