On Mon, Oct 29, 2012 at 1:43 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</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">
<div class="HOEnZb"><div class="h5">On Mon, Oct 29, 2012 at 1:28 PM, Richard Trieu <<a href="mailto:rtrieu@google.com">rtrieu@google.com</a>> wrote:<br>
> On Fri, Oct 26, 2012 at 5:37 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>><br>
> wrote:<br>
>><br>
>> On Fri, Oct 26, 2012 at 5:20 PM, Richard Trieu <<a href="mailto:rtrieu@google.com">rtrieu@google.com</a>> wrote:<br>
>> > -Wbool-compare-tautological<br>
>> > Comparisons involving a boolean and an expression evaluating to 1, 0,<br>
>> > true,<br>
>> > or false such that the comparison always evaluate to true or false.<br>
>> > Also added to -Wtautological-compare group<br>
>> > High true positive rate.<br>
>> > Not previously caught by -Wtautological-compare<br>
>><br>
>> Please just fix DiagnoseOutOfRangeComparison to do the right thing.<br>
>><br>
>> > -Wbool-compare-tautological-out-of-range<br>
>> > Comparisons of a boolean and >1 or negative values.<br>
>> > Also added to -Wtautological-constant-out-of-range-compare group<br>
>> > High true positive rate.<br>
>> > Previously, only compares with values >1 were caught.<br>
>> > (x == 5) currently caught<br>
>> > (x == -1) not currently caught<br>
>><br>
>> Same.<br>
>><br>
>> -Eli<br>
><br>
><br>
> What do you think of the idea of separating out warnings on bool comparisons<br>
> into a sub group?<br>
<br>
</div></div>I'm not exactly opposed... but why? The tautological compare warning<br>
is on by default anyway.<br></blockquote><div>I think that finer control over warnings is a good thing. And that this warning would fit in nicely if a new -Wbool-compare is created.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
(Either way, please fix DiagnoseOutOfRangeComparison instead of adding<br>
new code.)<br></blockquote><div>Yes, I am looking at it now. </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>
-Eli<br>
</font></span></blockquote></div><br>