On Thu, Sep 15, 2016 at 01:21:21PM -0600, Jeff Law wrote:
> On 09/05/2016 08:28 AM, Marek Polacek wrote:
> > > test.c:10:8: note: add parentheses around left hand side expression to
> > > silence this warning
> > > r += !a == ~b;
> > > ^~
> > > ( )
> > >
> > > this will not f
On 09/05/2016 08:28 AM, Marek Polacek wrote:
test.c:10:8: note: add parentheses around left hand side expression to
silence this warning
r += !a == ~b;
^~
( )
this will not fix it, but make it worse.
I think a better warning would be
warning: ~ on boolean value, did you me
On Mon, Sep 05, 2016 at 10:35:26AM -0600, Sandra Loosemore wrote:
> On 09/05/2016 09:55 AM, Bernd Schmidt wrote:
> >
> >
> > On 09/05/2016 12:52 PM, Marek Polacek wrote:
> > > On Mon, Sep 05, 2016 at 12:35:13PM +0200, Bernd Schmidt wrote:
> > > > On 09/02/2016 05:13 PM, Marek Polacek wrote:
> > >
On 09/05/16 18:45, Joseph Myers wrote:
> On Mon, 5 Sep 2016, Marek Polacek wrote:
>
>> Still not sure about other operations. I guess no one would
>> object to warning on bool1 % bool2, but should we warn for
>> bool1 + bool2?
>
> I think boolean addition (with the result interpreted as an integer
On Mon, 5 Sep 2016, Marek Polacek wrote:
> Still not sure about other operations. I guess no one would
> object to warning on bool1 % bool2, but should we warn for
> bool1 + bool2?
I think boolean addition (with the result interpreted as an integer, not
converted back to boolean) is perfectly r
On 09/05/2016 09:55 AM, Bernd Schmidt wrote:
On 09/05/2016 12:52 PM, Marek Polacek wrote:
On Mon, Sep 05, 2016 at 12:35:13PM +0200, Bernd Schmidt wrote:
On 09/02/2016 05:13 PM, Marek Polacek wrote:
diff --git gcc/doc/invoke.texi gcc/doc/invoke.texi
index 87da1f1..38d55d4 100644
--- gcc/doc/i
On 09/05/2016 12:52 PM, Marek Polacek wrote:
On Mon, Sep 05, 2016 at 12:35:13PM +0200, Bernd Schmidt wrote:
On 09/02/2016 05:13 PM, Marek Polacek wrote:
diff --git gcc/doc/invoke.texi gcc/doc/invoke.texi
index 87da1f1..38d55d4 100644
--- gcc/doc/invoke.texi
+++ gcc/doc/invoke.texi
@@ -5437,8
On 09/05/16 17:00, Eric Gallager wrote:
> On 9/5/16, Bernd Edlinger wrote:
>> On 09/05/16 14:03, Marek Polacek wrote:
>>> On Fri, Sep 02, 2016 at 03:51:49PM +, Bernd Edlinger wrote:
Hi,
> + r += !a == ~b;
> + r += !a == ~(int) b;
I don't understand why ~b
On 09/05/16 16:28, Marek Polacek wrote:
> On Mon, Sep 05, 2016 at 02:08:20PM +, Bernd Edlinger wrote:
>> On 09/05/16 14:03, Marek Polacek wrote:
>>> On Fri, Sep 02, 2016 at 03:51:49PM +, Bernd Edlinger wrote:
Hi,
> + r += !a == ~b;
> + r += !a == ~(int) b;
>
On 9/5/16, Bernd Edlinger wrote:
> On 09/05/16 14:03, Marek Polacek wrote:
>> On Fri, Sep 02, 2016 at 03:51:49PM +, Bernd Edlinger wrote:
>>> Hi,
>>>
>>> > + r += !a == ~b;
>>> > + r += !a == ~(int) b;
>>>
>>> I don't understand why ~b should not be warned at -Wall.
>>
>> Yeah, there was
On Mon, Sep 05, 2016 at 02:08:20PM +, Bernd Edlinger wrote:
> On 09/05/16 14:03, Marek Polacek wrote:
> > On Fri, Sep 02, 2016 at 03:51:49PM +, Bernd Edlinger wrote:
> >> Hi,
> >>
> >> > + r += !a == ~b;
> >> > + r += !a == ~(int) b;
> >>
> >> I don't understand why ~b should not be w
On 09/05/16 14:03, Marek Polacek wrote:
> On Fri, Sep 02, 2016 at 03:51:49PM +, Bernd Edlinger wrote:
>> Hi,
>>
>> > + r += !a == ~b;
>> > + r += !a == ~(int) b;
>>
>> I don't understand why ~b should not be warned at -Wall.
>
> Yeah, there was an RFE for this but I'm not finding it.
>
I
On Fri, Sep 02, 2016 at 03:51:49PM +, Bernd Edlinger wrote:
> Hi,
>
> > + r += !a == ~b;
> > + r += !a == ~(int) b;
>
> I don't understand why ~b should not be warned at -Wall.
Yeah, there was an RFE for this but I'm not finding it.
> Frankly I don't even understand why the above state
On Mon, Sep 05, 2016 at 12:35:13PM +0200, Bernd Schmidt wrote:
> On 09/02/2016 05:13 PM, Marek Polacek wrote:
> > diff --git gcc/doc/invoke.texi gcc/doc/invoke.texi
> > index 87da1f1..38d55d4 100644
> > --- gcc/doc/invoke.texi
> > +++ gcc/doc/invoke.texi
> > @@ -5437,8 +5437,8 @@ if (a < 0 && a < 0
On 09/02/2016 05:13 PM, Marek Polacek wrote:
diff --git gcc/doc/invoke.texi gcc/doc/invoke.texi
index 87da1f1..38d55d4 100644
--- gcc/doc/invoke.texi
+++ gcc/doc/invoke.texi
@@ -5437,8 +5437,8 @@ if (a < 0 && a < 0) @{ @dots{} @}
@opindex Wlogical-not-parentheses
@opindex Wno-logical-not-parent
Hi,
> + r += !a == ~b;
> + r += !a == ~(int) b;
I don't understand why ~b should not be warned at -Wall.
Frankly I don't even understand why the above statements are
completely optimized away.
r += !a == ~b;
is optimized away, but
b = ~b;
r += !a == b;
Is not. Why?
Bernd.
Martin reported that -Wlogical-not-parentheses issues a bogus warning
for bit operations on booleans, because the warning didn't take integer
promotions into account. The following patch ought to fix this problem.
It's not exactly trivial because I had to handle even more complex
expressions and
17 matches
Mail list logo