<div class="gmail_quote"><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 class="im"><div>I don't think these warnings would be suitable for Clang. </div>
</div></div></div></blockquote><div><br></div><div>Even suggesting nullptr in C++11? With things like the bool warning, NULL* used in non-pointer contexts, etc already, this seems like a fairly logical continuation/generalization of that - or would you say that, even in C++11, that it's clear that false is probably not intended as a pointer literal but still likely that someone should use 0/NULL/etc rather than nullptr?</div>
<br>Or perhaps these existing warnings are more a case of GCC compatibility, but not really the direction you'd prefer to clang to go in if it weren't for GCC's legacy.</div><div class="gmail_quote"><br></div>
<div class="gmail_quote">* GCC built the whole __null construct to help catch these issues. Now that we have a null pointer type we don't even have to do that - we just treat it as the "proper nullptr literal" & warn about anything else (& warn about NULL usage).<br>
<div><br></div><div>[hmm, on the 0/NULL case in C++98 - does clang support the possibility of alternative fixits? ("make this change or this change") though of course that'd reduce/remove the easy migration benefit in C++98 code]<br>
<br></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 class="im"><div>Such style-checking transformations belong in a separate tool (e.g., like the ARC migrator).</div>
</div></div></div></blockquote><div><br></div><div>I'll have to look into how the ARC migrator works - both for the migration & for keeping code style consistent in the long term. That's part of what I was getting at - I turn on the "use nullptr" warning & then I'm never going to accidentally end up with weird uses of NULL or 0/false/etc in my code (or even in llvm's code if there was a nice way to implement some C++98 equivalent), ideally.</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 class="im"><br><blockquote type="cite"><div class="gmail_quote">
<div>[curiously - clang -cc1 foo.cpp doesn't enable colored diagnostics by default (when run on a terminal capable of color - where clang foo.cpp does use color). Is that by design?]</div></div>
</blockquote><br></div></div><div>Yes. clang -cc1 is just the internal interface to the compiler. The driver makes all of the interesting decisions, such as detecting whether the terminal supports color.</div></div></blockquote>
<div><br></div><div>Makes sense. Thanks,</div><div><br></div><div>- David </div></div>