Thanks for the feedback! First cut checked in as r122804 with most of your comments addressed.<div><br><div class="gmail_quote">On Mon, Jan 3, 2011 at 6:28 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div><div>Turn this on with -Wall, perhaps? I'd eventually like to have this on by default, but starting with -Wall seems best.</div>
</div></div></blockquote><div><br></div><div>Sure, I'll be bold. =] Easy enough to turn off if needed.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div><div>Hrm, should you check whether the type of the declaration is a volatile (or a reference to volatile)?</div></div></div></div></blockquote><div><br></div><div>Yea, this is a good catch. Feel free to take a look at the submit, I tested the obvious patterns.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div><div><div>It would be really nice if we could follow up this warning with a note + Fix-It, e.g.,</div>
</div></div></div></blockquote><div><br></div><div>Why, yes it would. ;] I was already headed here but...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div><div><br></div><div> note: cast 'thevariablename' to 'void' to silence this warning</div><div><br></div><div>with a Fix-It that replaces the expression with</div>
<div><br></div><div> (void)thevariablename</div><div><br></div><div>Perhaps we could add this note as a follow-on when an expression statement consists of just a self-assignment?</div></div></div></div></blockquote><div>
<br></div><div>This is a good idea about how to key the fix-it hint. I'll submit this as a follow-up, and then run it over LLVM and Clang, as it seems we aren't immune to this code pattern. =D</div></div></div>