All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	ehabkost@redhat.com, Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 1/3] monitor: avoid clang shifting negative signed warning
Date: Tue, 10 Nov 2015 15:57:33 +0000	[thread overview]
Message-ID: <1447171055-29567-2-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1447171055-29567-1-git-send-email-stefanha@redhat.com>

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 <stefanha@redhat.com>
---
 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	other threads:[~2015-11-10 15:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 15:57 [Qemu-devel] [PATCH 0/3] fix clang negative signed bit shift warning Stefan Hajnoczi
2015-11-10 15:57 ` Stefan Hajnoczi [this message]
2015-11-13 15:37   ` [Qemu-devel] [PATCH 1/3] monitor: avoid clang shifting negative signed warning Eduardo Habkost
2015-11-10 15:57 ` [Qemu-devel] [PATCH 2/3] tpm: " Stefan Hajnoczi
2015-11-10 15:57 ` [Qemu-devel] [PATCH 3/3] disas/arm: " Stefan Hajnoczi
2015-11-10 17:33   ` Paolo Bonzini
2015-11-10 17:48     ` Peter Maydell
2015-11-10 17:59       ` Paolo Bonzini
2015-11-10 18:52       ` Markus Armbruster
2015-11-10 19:51         ` Steven Noonan
2015-11-10 20:06           ` Markus Armbruster
2015-11-10 20:17             ` Steven Noonan
2015-11-10 20:18           ` Paolo Bonzini
2015-11-10 16:04 ` [Qemu-devel] [PATCH 0/3] fix clang negative signed bit shift warning Peter Maydell
2015-11-16 14:23 ` Peter Maydell
2015-11-16 15:20   ` Peter Maydell
2015-11-17  3:50     ` Stefan Hajnoczi
2015-11-17  3:53 ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447171055-29567-2-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.