Re: [Qemu-devel] [RFC] spapr_drc: Fix potential undefined behaviour

2015-09-02 Thread Alexey Kardashevskiy
On 09/01/2015 01:17 PM, David Gibson wrote: The DRC_INDEX_ID_MASK macro does a left shift on ~0, which is a signed quantity, and therefore undefined behaviour according to the C spec. In particular this causes warnings from the clang sanitizer. This fixes it by calculating the same mask without

[Qemu-devel] [RFC] spapr_drc: Fix potential undefined behaviour

2015-08-31 Thread David Gibson
The DRC_INDEX_ID_MASK macro does a left shift on ~0, which is a signed quantity, and therefore undefined behaviour according to the C spec. In particular this causes warnings from the clang sanitizer. This fixes it by calculating the same mask without using ~0 (I think the new method is a more co