[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer warnings |
Date: |
Fri, 06 Feb 2015 09:30:02 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 02/06/2015 08:43 AM, Peter Maydell wrote:
> On 6 February 2015 at 16:20, Richard Henderson <address@hidden> wrote:
>> It should be enough to simply add the unsigned suffix to the integers as they
>> are, forcing the underlying type to be unsigned.
>
> I can't see anything in the C99 spec that justifies this
> as a fix... In fact, 6.7.2.2 para 3 says
> "The identifiers in an enumerator list are declared as
> constants that have type int", which sounds to me like it
> means "if you have enum { foo = ..., }; then 'foo' must
> have (signed) integer type even if the representation
> of the enum type is unsigned".
Hum. True, despite the talk in para 4 about the compatible type of the
enumeration. Which is why my test worked with a variable of enum type, but
doesn't work with one of the enum members.
Oh well.
r~
- [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer warnings, Peter Maydell, 2015/02/06
- [Qemu-devel] [PATCH 4/4] target-arm: A64: Avoid signed shifts in disas_ldst_pair(), Peter Maydell, 2015/02/06
- [Qemu-devel] [PATCH 2/4] target-arm: A64: Fix handling of rotate in logic_imm_decode_wmask, Peter Maydell, 2015/02/06
- [Qemu-devel] [PATCH 1/4] target-arm: A64: Fix shifts into sign bit, Peter Maydell, 2015/02/06
- [Qemu-devel] [PATCH 3/4] target-arm: A64: Avoid left shifting negative integers in disas_pc_rel_addr, Peter Maydell, 2015/02/06
- Re: [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer warnings, Greg Bellows, 2015/02/06
- Re: [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer warnings, Richard Henderson, 2015/02/06
- Re: [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer warnings, Eric Blake, 2015/02/06