qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: QEMU Developers <qemu-devel@nongnu.org>
Cc: Juergen Lock <nox@jelal.kn-bremen.de>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH] Avoid compiler error
Date: Sat, 10 Apr 2010 09:26:03 +0200	[thread overview]
Message-ID: <1270884363-5186-1-git-send-email-weil@mail.berlios.de> (raw)

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 <rth@twiddle.net>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 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

             reply	other threads:[~2010-04-10  7:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-10  7:26 Stefan Weil [this message]
2010-04-10 15:15 ` [Qemu-devel] Re: [PATCH] Avoid compiler error Aurelien Jarno
2010-04-10 18:43 ` Richard Henderson

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=1270884363-5186-1-git-send-email-weil@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=aurelien@aurel32.net \
    --cc=nox@jelal.kn-bremen.de \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).