qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 1/3] monitor: avoid clang shifting negative signed w


From: Stefan Hajnoczi
Subject: [Qemu-devel] [PATCH 1/3] monitor: avoid clang shifting negative signed warning
Date: Tue, 10 Nov 2015 15:57:33 +0000

clang 3.7.0 on x86_64 warns about the following:

  target-i386/monitor.c:38:22: warning: shifting a negative signed value is 
undefined [-Wshift-negative-value]
        addr |= -1LL << 48;
                ~~~~ ^

Signed-off-by: Stefan Hajnoczi <address@hidden>
---
 target-i386/monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-i386/monitor.c b/target-i386/monitor.c
index aac6b1b..6f5c280 100644
--- a/target-i386/monitor.c
+++ b/target-i386/monitor.c
@@ -35,7 +35,7 @@ static void print_pte(Monitor *mon, hwaddr addr,
 {
 #ifdef TARGET_X86_64
     if (addr & (1ULL << 47)) {
-        addr |= -1LL << 48;
+        addr |= ~0ULL << 48;
     }
 #endif
     monitor_printf(mon, TARGET_FMT_plx ": " TARGET_FMT_plx
-- 
2.5.0




reply via email to

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