From: Eric Blake <eblake@redhat.com>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: qemu-trivial@nongnu.org, Stefan Weil <sw@weilnetz.de>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] target-mips: Fix compiler warnings caused by very large constants
Date: Mon, 05 Nov 2012 11:41:15 -0700 [thread overview]
Message-ID: <5098084B.2060105@redhat.com> (raw)
In-Reply-To: <20121105070340.GH31495@ohm.aurel32.net>
[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]
On 11/05/2012 12:03 AM, Aurelien Jarno wrote:
> On Sun, Nov 04, 2012 at 09:29:35PM +0100, Stefan Weil wrote:
>> Those constants are larger than 32 bits and need a suffix to avoid
>> warnings from some versions of gcc.
>>
>> Signed-off-by: Stefan Weil <sw@weilnetz.de>
>> @@ -3653,7 +3653,7 @@ target_ulong helper_extr_s_h(target_ulong ac, target_ulong shift,
>> if (temp > (int64_t)0x7FFF) {
>> temp = 0x00007FFF;
>> set_DSPControl_overflow_flag(1, 23, env);
>> - } else if (temp < (int64_t)0xFFFFFFFFFFFF8000) {
>> + } else if (temp < (int64_t)0xFFFFFFFFFFFF8000LL) {
Instead of using both a suffix and a cast to int64_t, shouldn't we
instead be writing '(temp < INT64_C(0xFFFFFFFFFFFF8000))'?
>
> Blue Swirl proposed the same patch a bit earlier then you, and I have
> just applied it.
But since I've seldom seen code using the *_C() macros from <stdint.h>,
it doesn't bother me enough to pursue it any further now that the
immediate concern of compiler warnings has been silenced.
--
Eric Blake eblake@redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 617 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Eric Blake <eblake@redhat.com>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: qemu-trivial@nongnu.org, Stefan Weil <sw@weilnetz.de>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] target-mips: Fix compiler warnings caused by very large constants
Date: Mon, 05 Nov 2012 11:41:15 -0700 [thread overview]
Message-ID: <5098084B.2060105@redhat.com> (raw)
In-Reply-To: <20121105070340.GH31495@ohm.aurel32.net>
[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]
On 11/05/2012 12:03 AM, Aurelien Jarno wrote:
> On Sun, Nov 04, 2012 at 09:29:35PM +0100, Stefan Weil wrote:
>> Those constants are larger than 32 bits and need a suffix to avoid
>> warnings from some versions of gcc.
>>
>> Signed-off-by: Stefan Weil <sw@weilnetz.de>
>> @@ -3653,7 +3653,7 @@ target_ulong helper_extr_s_h(target_ulong ac, target_ulong shift,
>> if (temp > (int64_t)0x7FFF) {
>> temp = 0x00007FFF;
>> set_DSPControl_overflow_flag(1, 23, env);
>> - } else if (temp < (int64_t)0xFFFFFFFFFFFF8000) {
>> + } else if (temp < (int64_t)0xFFFFFFFFFFFF8000LL) {
Instead of using both a suffix and a cast to int64_t, shouldn't we
instead be writing '(temp < INT64_C(0xFFFFFFFFFFFF8000))'?
>
> Blue Swirl proposed the same patch a bit earlier then you, and I have
> just applied it.
But since I've seldom seen code using the *_C() macros from <stdint.h>,
it doesn't bother me enough to pursue it any further now that the
immediate concern of compiler warnings has been silenced.
--
Eric Blake eblake@redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 617 bytes --]
next prev parent reply other threads:[~2012-11-05 18:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-04 20:29 [Qemu-trivial] [PATCH] target-mips: Fix compiler warnings caused by very large constants Stefan Weil
2012-11-04 20:29 ` [Qemu-devel] " Stefan Weil
2012-11-05 7:03 ` [Qemu-trivial] " Aurelien Jarno
2012-11-05 7:03 ` [Qemu-devel] " Aurelien Jarno
2012-11-05 18:41 ` Eric Blake [this message]
2012-11-05 18:41 ` Eric Blake
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=5098084B.2060105@redhat.com \
--to=eblake@redhat.com \
--cc=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=sw@weilnetz.de \
/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.