<div class="gmail_quote">On Sun, Jun 19, 2011 at 1:24 AM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><div class="gmail_quote">On Fri, Jun 17, 2011 at 7:38 PM, Richard Trieu <span dir="ltr"><<a href="mailto:rtrieu@google.com" target="_blank">rtrieu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

-Wnull-arithmetic was catching some false positives.  Switch the checking code so that it will warn on specific types instead of not warning on specific types.  Now, comparisons between non-boolean arithmetic types and NULL will give this warning.  New types to warn on can be added later if needed.
</blockquote></div><br></div><div>I'm a bit worried that the set of things we *don't* want to warn about is more clearly defined than the set of things we *do*. I'm inclined to implement the warning accordingly. I think we just need something more forgiving than 'isPointerType'. I'm looking at committing a variation of this patch (your test cases are excellent) that instead enhances the AST to have an interface specifically designed to represent this class of types. We can implement that much more efficiently as a bonus, and this is a hot-path in Clang.</div>

</blockquote></div><br><div>I implemented this idea in r133383. Please review Richard and let me know your thoughts. Also, if anyone else disagrees with this direction, we can switch back to Richard's original approach. =] Should be simple code changes.</div>