<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 5, 2014 at 4:20 PM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra">The undefined behavior isn't the check, but the code that preceded it and that made someone put in the fix:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">
  int* a = nullptr;<br></div><div class="gmail_extra">  int& ra = *a;  // Undefined! But also harmless in practice.</div><div class="gmail_extra"><br></div><div class="gmail_extra">  if (a == 5) {} // Crash! Better "fix" this by instead writing:</div>

<div class="gmail_extra">  if (&a && a == 5) {} // No crash! Except if the compiler rightfully optimizes away the &a check.</div><div class="gmail_extra"><br></div><div class="gmail_extra">If you don't have an ubsan bot, then it's possible that your code has references to null. That's undefined, but used to be safe in practice – but now that clang marks addresses of references as non-null, it isn't anymore. Wtautological-undefined-compare catches some of these places.</div>
</blockquote></div></div><br><div>Yea, I'm just pointing out that I can see an argument where its hard to argue that we shouldn't turn this warning off on code that doesn't care about tautological comparisons... =/ I don't really have a better idea of how to organize them.</div>
</div>