[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH] target-mips: Fix compiler warnin
From: |
Eric Blake |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 |
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 <address@hidden>
>> @@ -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 address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature