[PATCH] D24861: [Sema] extend Wshift-op-parentheses so it warns for multiplicative operators

Richard Trieu via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 3 17:42:18 PDT 2016


This warning group (-Wshift-op-parentheses) is already a subgroup of
-Wparentheses.  The suggestion of moving to a sub group was to create a new
subgroup, either as a child of -Wshift-op-parentheses or -Wparentheses, so
that this new warning can be turned on and off independently and allow it
to be off by default.

On Mon, Oct 3, 2016 at 3:26 AM, Daniel Marjamäki <
Daniel.Marjamaki at evidente.se> wrote:

> Hello!
>
> Moving it to a subgroup such as -Wparentheses is fine for me. I will look
> at that when I have time. Do you think this warning has an acceptable
> output then?
>
> Best regards,
> Daniel Marjamäki
>
> ............................................................
> ......................................................
> Daniel Marjamäki Senior Engineer
> Evidente ES East AB  Warfvinges väg 34  SE-112 51 Stockholm  Sweden
>
> Mobile:                 +46 (0)709 12 42 62
> E-mail:                 Daniel.Marjamaki at evidente.se
>
> www.evidente.se
>
> ________________________________________
> Från: Richard Trieu [rtrieu at google.com]
> Skickat: den 1 oktober 2016 00:41
> Till: reviews+D24861+public+1ab88c6ac93f51fd at reviews.llvm.org
> Kopia: Daniel Marjamäki; David Blaikie; joerg at netbsd.org;
> bruno.cardoso at gmail.com; cfe-commits
> Ämne: Re: [PATCH] D24861: [Sema] extend Wshift-op-parentheses so it warns
> for multiplicative operators
>
> Currently, this warning is on by default.  As you said, the results you
> found look intentional in many cases, so there is a high false positive
> rate.  For on by default warnings, we expect a high true positive rate and
> intend for users to not disable the warning.  From my analysis on a
> separate codebase, I found less than 10% true positive rate out of 200
> warnings.  One option might be to move this warning to a subgroup, which
> would leave it discoverable from either -Wall or -Wparentheses, but not
> have it on by default.
>
> On Wed, Sep 28, 2016 at 4:09 AM, Daniel Marjamäki <
> daniel.marjamaki at evidente.se<mailto:daniel.marjamaki at evidente.se>> wrote:
> danielmarjamaki added a comment.
>
> I updated the patch so it does not warn about 'A * B << C'. It's a simple
> fix. I have not made careful measurements but I guess that the performance
> penalty is acceptable.
>
>
> https://reviews.llvm.org/D24861
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161003/cdf03c8d/attachment.html>


More information about the cfe-commits mailing list