<div dir="ltr">Thanks for the info, Sean.  It's always nice to see my work in action.<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 11, 2013 at 9:41 AM, Sean McBride <span dir="ltr"><<a href="mailto:sean@rogue-research.com" target="_blank">sean@rogue-research.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I updated clang on my buildbot that builds the open source VTK project and it reported 4 unique -Wlogical-not-parentheses warnings:<br>
<<a href="http://open.cdash.org/viewBuildError.php?type=1&buildid=2933590" target="_blank">http://open.cdash.org/viewBuildError.php?type=1&buildid=2933590</a>><br>
<br>
I consider them to all be valid warnings either because the code really is wrong or could be made clearer anyway.<br>
<br>
My (hopefully correct) patch for VTK:<br>
<<a href="http://review.source.kitware.com/11566" target="_blank">http://review.source.kitware.com/11566</a>><br>
<br>
hth,<br>
<br>
Sean<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Mon, 10 Jun 2013 13:22:18 -0700, Nico Weber said:<br>
<br>
>Do you have numbers on the true positive rate of this new warning (give<br>
>that it's on by default)?<br>
><br>
><br>
>On Mon, Jun 10, 2013 at 11:52 AM, Richard Trieu <<a href="mailto:rtrieu@google.com">rtrieu@google.com</a>> wrote:<br>
><br>
>> Author: rtrieu<br>
>> Date: Mon Jun 10 13:52:07 2013<br>
>> New Revision: 183688<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=183688&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=183688&view=rev</a><br>
>> Log:<br>
>> Add a new warning, -Wlogical-not-parentheses, to -Wparentheses.<br>
>><br>
>> This warning triggers on the logical not of a non-boolean expression on the<br>
>> left hand side of comparison.  Often, the user meant to negate the<br>
>> comparison,<br>
>> not just the left hand side of the comparison.  Two notes are also emitted,<br>
>> the first with a fix-it to add parentheses around the comparison, and the<br>
>> other<br>
>> to put parenthesis around the not expression to silence the warning.<br>
>><br>
>> bool not_equal(int x, int y) {<br>
>>   return !x == y;  // warn here<br>
>> }<br>
>><br>
>>   return !(x == y);  // first fix-it, to negate comparison.<br>
>><br>
>>   return (!x) == y;  // second fix-it, to silence warning.<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>