From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwBIt-0004Ex-7K for qemu-devel@nongnu.org; Tue, 10 Nov 2015 10:57:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwBIi-0003Wq-SE for qemu-devel@nongnu.org; Tue, 10 Nov 2015 10:57:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwBIi-0003WV-Ln for qemu-devel@nongnu.org; Tue, 10 Nov 2015 10:57:40 -0500 From: Stefan Hajnoczi Date: Tue, 10 Nov 2015 15:57:33 +0000 Message-Id: <1447171055-29567-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1447171055-29567-1-git-send-email-stefanha@redhat.com> References: <1447171055-29567-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 1/3] monitor: avoid clang shifting negative signed warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , ehabkost@redhat.com, Stefan Hajnoczi 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 --- 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