Re: c-family PATCH to improve -Wtautological-compare (PR c/81783)

2017-09-01 Thread Jeff Law
On 08/16/2017 08:29 AM, Marek Polacek wrote: > This patch improves -Wtautological-compare so that it also detects > bitwise comparisons involving & and | that are always true or false, e.g. > > if ((a & 16) == 10) > return 1; > > can never be true. Note that e.g. "(a & 9) == 8" is *not*

Re: c-family PATCH to improve -Wtautological-compare (PR c/81783)

2017-09-01 Thread Marek Polacek
Ping. On Fri, Aug 25, 2017 at 02:47:45PM +0200, Marek Polacek wrote: > Ping. > > On Wed, Aug 16, 2017 at 05:24:56PM +0200, Marek Polacek wrote: > > On Wed, Aug 16, 2017 at 11:07:36AM -0400, David Malcolm wrote: > > > On Wed, 2017-08-16 at 16:29 +0200, Marek Polacek wrote: > > > > This patch

Re: c-family PATCH to improve -Wtautological-compare (PR c/81783)

2017-08-25 Thread Marek Polacek
Ping. On Wed, Aug 16, 2017 at 05:24:56PM +0200, Marek Polacek wrote: > On Wed, Aug 16, 2017 at 11:07:36AM -0400, David Malcolm wrote: > > On Wed, 2017-08-16 at 16:29 +0200, Marek Polacek wrote: > > > This patch improves -Wtautological-compare so that it also detects > > > bitwise comparisons

Re: c-family PATCH to improve -Wtautological-compare (PR c/81783)

2017-08-16 Thread Marek Polacek
On Wed, Aug 16, 2017 at 11:07:36AM -0400, David Malcolm wrote: > On Wed, 2017-08-16 at 16:29 +0200, Marek Polacek wrote: > > This patch improves -Wtautological-compare so that it also detects > > bitwise comparisons involving & and | that are always true or false, > > e.g. > > > > if ((a & 16)

Re: c-family PATCH to improve -Wtautological-compare (PR c/81783)

2017-08-16 Thread Eric Gallager
On 8/16/17, David Malcolm wrote: > On Wed, 2017-08-16 at 16:29 +0200, Marek Polacek wrote: >> This patch improves -Wtautological-compare so that it also detects >> bitwise comparisons involving & and | that are always true or false, >> e.g. >> >> if ((a & 16) == 10) >>

Re: c-family PATCH to improve -Wtautological-compare (PR c/81783)

2017-08-16 Thread David Malcolm
On Wed, 2017-08-16 at 16:29 +0200, Marek Polacek wrote: > This patch improves -Wtautological-compare so that it also detects > bitwise comparisons involving & and | that are always true or false, > e.g. > > if ((a & 16) == 10) > return 1; > > can never be true. Note that e.g. "(a & 9) ==

c-family PATCH to improve -Wtautological-compare (PR c/81783)

2017-08-16 Thread Marek Polacek
This patch improves -Wtautological-compare so that it also detects bitwise comparisons involving & and | that are always true or false, e.g. if ((a & 16) == 10) return 1; can never be true. Note that e.g. "(a & 9) == 8" is *not* always false or true. I think it's pretty straightforward