Message missing from gcc-patches

Bernd Edlinger bernd.edlinger@hotmail.de
Thu Sep 15 17:12:00 GMT 2016


Hi,

this message did not get listed on the gcc-patches archive.
I've got no bounce, and it just vanished, several times.

Any idea what is wrong?


Bernd.


-------- Forwarded Message --------
Subject: [PATCHv3, resent] Add a warning for suspicious use of 
conditional expressions in boolean context
Date: Thu, 15 Sep 2016 11:19:32 +0200
From: Bernd Edlinger <bernd.edlinger@hotmail.de>
To: GCC Patches <gcc-patches@gcc.gnu.org>
CC: Jason Merrill <jason@redhat.com>, Jeff Law <law@redhat.com>, Joseph 
Myers <joseph@codesourcery.com>

Hi,

I send the latest version of the warning patch again, because I don't
see the previous patch submission on the gcc-patches list.  It dropped
out silently, twice :(

Don't know what went wrong, so please excuse me if this e-mail arrives
duplicate.


On 09/14/16 20:11, Jason Merrill wrote:
>>
>> Yes.  The reasoning I initially had was that it is completely
>> pointless to have something of the form "if (x ? 1 : 2)" or
>> "if (x ? 0 : 0)" because the result does not even depend on x
>> in this case.  But something like "if (x ? 4999 : 0)" looks
>> bogus but does at least not ignore x.
>>
>> If the false-positives are becoming too much of a problem here,
>> then I should of course revert to the previous heuristic again.
>
> I think we could have both, where the weaker form is part of -Wall and
> people can explicitly select the stronger form.
>


Yes, agreed.  So here is what I would think will be the first version.

It can later be extended to cover the more pedantic cases which
will not be enabled by -Wall.

I would like to send a follow-up patch for the warning on
signed-integer shift left in boolean context, which I think
should also be good for Wall.
(I already had that feature in patch version 2 but that's meanwhile
outdated).


Bootstrap and reg-testing on x86_64-pc-linux-gnu.
Is it OK for trunk?


Thanks
Bernd.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: changelog-pr77434v3.txt
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20160915/16eb756f/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-pr77434v3.diff
Type: text/x-patch
Size: 6590 bytes
Desc: patch-pr77434v3.diff
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20160915/16eb756f/attachment.bin>


More information about the Gcc mailing list