qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jindrich Makovicka <makovick@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] target-i386/helper.c: some constants can get truncated on 32bit
Date: Tue, 1 Jul 2008 23:00:02 +0200	[thread overview]
Message-ID: <20080701230002.5d47275a@holly> (raw)

Hi,

with

./configure --target-list=x86_64-softmmu

32-bit gcc produces warnings about a few constants with an L suffix:

/home/henry/build/qemu/trunk/target-i386/helper.c: In function
‘cpu_x86_handle_mmu_fault’: /home/henry/build/qemu/trunk/target-i386/helper.c:903:
warning: integer constant is too large for ‘long’
type /home/henry/build/qemu/trunk/target-i386/helper.c:933: warning:
integer constant is too large for ‘long’
type /home/henry/build/qemu/trunk/target-i386/helper.c:969: warning:
integer constant is too large for ‘long’
type /home/henry/build/qemu/trunk/target-i386/helper.c:977: warning:
integer constant is too large for ‘long’
type /home/henry/build/qemu/trunk/target-i386/helper.c:1012: warning:
integer constant is too large for ‘long’ type

These should be probably defined as long long to avoid truncation:

--- helper.c.orig	2008-06-16 20:25:16.000000000 +0200
+++ helper.c	2008-06-17 12:26:00.000000000 +0200
@@ -822,9 +822,9 @@
 #define PHYS_ADDR_MASK 0xfffff000L
 #else
 # if defined(TARGET_X86_64)
-# define PHYS_ADDR_MASK 0xfffffff000L
+# define PHYS_ADDR_MASK 0xfffffff000LL
 # else
-# define PHYS_ADDR_MASK 0xffffff000L
+# define PHYS_ADDR_MASK 0xffffff000LL
 # endif
 #endif
 
Regards,
-- 
Jindrich Makovicka

                 reply	other threads:[~2008-07-01 21:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080701230002.5d47275a@holly \
    --to=makovick@gmail.com \
    --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 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).