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

2013-01-16 Thread Junio C Hamano
Junio C Hamano writes: > Antoine Pelisse 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 >>

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

2013-01-16 Thread Junio C Hamano
Antoine Pelisse 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 into th

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 wrote: > On Thu, Jan 17, 2013 at 12:08 AM, John Keeping wrote: >> On Wed, Jan 16, 2013 at 11:47:22PM +0100, Antoine Pelisse wrote: >

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 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 truncated. > W

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

[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