<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 12, 2012, at 11:10 AM, Richard Trieu <<a href="mailto:rtrieu@google.com">rtrieu@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Fri, Oct 12, 2012 at 9:55 AM, Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How many lines of code have you compiled with this warning enabled?<br></blockquote><div>Millions. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How many bugs did it catch?<br></blockquote><div>Hundreds. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How many false positives did it have?<br></blockquote><div>I have only checked a few dozen so far.  No false positives so far.</div></div></blockquote><div><br></div><div>This makes sense to me, use of a < comparison on a bool isn't something a "normal" person would write :)</div><div><br></div><div>-Chris</div><br><blockquote type="cite"><div class="gmail_quote"><div>Of course, there's some code like r165811 and r165812 that I just fixed, which technically works properly, but could be written in a different way.</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
-- Sean Silva<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Fri, Oct 12, 2012 at 12:38 PM, Richard Trieu <<a href="mailto:rtrieu@google.com">rtrieu@google.com</a>> wrote:<br>
> This patch is for a new warning to Clang, called -Wlogical-not-compare.  It<br>
> is designed to catch the case where the user is attempting to negate a<br>
> comparison, but only manages to negate the LHS because of missing parens.<br>
> For instance, warn here:<br>
><br>
>      if (!x < 5)<br>
><br>
> The user probably meant:<br>
><br>
>      if (!(x < 5))<br>
><br>
> or<br>
><br>
>      if (x >= 5)<br>
><br>
> When emitted, the warning will have a note suggesting this as a fix-it (drop<br>
> the not and inverting the comparison operator).<br>
><br>
> Also, a second note will be offer parenthesis around the LHS to silence this<br>
> warning.<br>
><br>
>      if ((!x) < 5)<br>
><br>
> This will not warn.<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
</div></div></blockquote></div><br>
_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></blockquote></div><br></body></html>