<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Aug 5, 2014 at 4:24 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class=""><br>
<div class="gmail_quote">On Tue, Aug 5, 2014 at 4:22 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>IMO there is a big difference.  All compilers have always returned true for unsigned >= 0, but other compilers may return true for &reference == nullptr.</div>

<div><br></div><div>
So, we can ignore the unsigned >= 0 warning so long as we are reasonably confident in past test coverage.</div><div><br></div><div>However, with the &reference == nullptr behavior change, we don't have that confidence.  Therefore it is more severe.</div>

</blockquote></div><br></div>FWIW, I think this might be a good reason to default the warning to on, but it still seems like a somewhat tenuous argument for '-Wno-tautological-compare' to leave this warning enabled...</div>
</div></blockquote><div><br>The argument is:</div><div>1. Wtautological-compare used to warn on relatively harmless things. This warning has been around in older clang releases.</div><div>2. People disable it for some of their code.</div>
<div>3. clang later adds an optimization to remove null-comparisons of addresses of references. This is standards-conforming, but it might break some existing code. As mitigation, it adds Wtautological-undefined-compare (at least that's what I thought the motivation was). This is new in 3.5.</div>
<div>4. But due to 2, people might not see it and their code breaks needlessly with 3.5.</div><div><br></div><div>If the warning was just called (say) Wnull-reference and if it was in its own warning group, this wouldn't happen.</div>
</div></div></div>