<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 24, 2011, at 8:00 PM, David Blaikie wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">On Wed, Aug 24, 2011 at 11:39 AM, 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 class="im"><br>
On Aug 21, 2011, at 9:13 PM, David Blaikie wrote:<br>
<br>
> in this case I was just<br>
> wondering if there was a simple tool to apply Clang's suggested<br>
> FixIts<br>
<br>
</div>Have you looked at the -cc1 option "-fixit", which applies Fix-Its in place?<br></blockquote><div><br></div><div>That's precisely what I was looking for - thanks.</div><div><br></div><div>So by enabling specific warnings (if my hypothetical "always use nullptr in pointer contexts & always use literal 0/false/etc in non-pointer contexts" fixits were implemented) I could quickly transition an entire codebase to a specific style. Lovely.<br>
<br>Any thoughts on whether such warnings would be suitable? how to handle their overlap with existing more specific warnings & how to handle mutually exclusive warnings (in C++98 land some people might want a warning about using NULL (preferring 0), even in pointer contexts, others might want a warning about 0 in pointer contexts (prefering NULL))?<br></div></div></blockquote><div><br></div><div>I don't think these warnings would be suitable for Clang. Such style-checking transformations belong in a separate tool (e.g., like the ARC migrator).</div><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>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><br></div><div><span class="Apple-tab-span" style="white-space:pre">    </span>- Doug</div><br></body></html>