Re: [Qemu-devel] [PATCH] hw/ide/ahci.c: Fix shift left into sign bit

2015-10-18 Thread Peter Maydell
On 16 October 2015 at 21:43, John Snow wrote: > > > On 10/16/2015 01:48 PM, Peter Maydell wrote: >> Avoid undefined behaviour from shifting left into the sign bit: >> >> hw/ide/ahci.c:551:36: runtime error: left shift of 255 by 24 places cannot >> be represented in type 'int' >> >> (Unfortunately

Re: [Qemu-devel] [PATCH] hw/ide/ahci.c: Fix shift left into sign bit

2015-10-16 Thread John Snow
On 10/16/2015 01:48 PM, Peter Maydell wrote: > Avoid undefined behaviour from shifting left into the sign bit: > > hw/ide/ahci.c:551:36: runtime error: left shift of 255 by 24 places cannot be > represented in type 'int' > > (Unfortunately C's promotion rules mean that in the expression > "som

[Qemu-devel] [PATCH] hw/ide/ahci.c: Fix shift left into sign bit

2015-10-16 Thread Peter Maydell
Avoid undefined behaviour from shifting left into the sign bit: hw/ide/ahci.c:551:36: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' (Unfortunately C's promotion rules mean that in the expression "some_uint8_t_variable << 24" the LHS gets promoted to signed int