[PATCH 1/2] fix clang -Wconstant-conversion with bit fields

2013-01-16 Thread Antoine Pelisse
clang incorrectly reports a constant conversion warning (implicit truncation to bit field) when using the flag = ~FLAG form, because ~FLAG needs to be truncated. Convert this form to flag = flag ~FLAG fixes the issue as the right operand now fits into the bit field. Signed-off-by: Antoine

Re: [PATCH 1/2] fix clang -Wconstant-conversion with bit fields

2013-01-16 Thread John Keeping
On Wed, Jan 16, 2013 at 11:47:22PM +0100, Antoine Pelisse wrote: clang incorrectly reports a constant conversion warning (implicit truncation to bit field) when using the flag = ~FLAG form, because ~FLAG needs to be truncated. Convert this form to flag = flag ~FLAG fixes the issue as the

Re: [PATCH 1/2] fix clang -Wconstant-conversion with bit fields

2013-01-16 Thread Antoine Pelisse
On Thu, Jan 17, 2013 at 12:08 AM, John Keeping j...@keeping.me.uk wrote: On Wed, Jan 16, 2013 at 11:47:22PM +0100, Antoine Pelisse wrote: clang incorrectly reports a constant conversion warning (implicit truncation to bit field) when using the flag = ~FLAG form, because ~FLAG needs to be

Re: [PATCH 1/2] fix clang -Wconstant-conversion with bit fields

2013-01-16 Thread Antoine Pelisse
So I guess we should drop this patch, it's probably not worth it, especially if it's been fixed already by clang. On Thu, Jan 17, 2013 at 12:09 AM, Antoine Pelisse apeli...@gmail.com wrote: On Thu, Jan 17, 2013 at 12:08 AM, John Keeping j...@keeping.me.uk wrote: On Wed, Jan 16, 2013 at

Re: [PATCH 1/2] fix clang -Wconstant-conversion with bit fields

2013-01-16 Thread Junio C Hamano
Antoine Pelisse apeli...@gmail.com writes: clang incorrectly reports a constant conversion warning (implicit truncation to bit field) when using the flag = ~FLAG form, because ~FLAG needs to be truncated. Convert this form to flag = flag ~FLAG fixes the issue as the right operand now fits

Re: [PATCH 1/2] fix clang -Wconstant-conversion with bit fields

2013-01-16 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Antoine Pelisse apeli...@gmail.com writes: clang incorrectly reports a constant conversion warning (implicit truncation to bit field) when using the flag = ~FLAG form, because ~FLAG needs to be truncated. Convert this form to flag = flag ~FLAG