[cfe-dev] null pointer literals, warnings, and fixups

David Blaikie dblaikie at gmail.com
Wed Aug 24 20:00:34 PDT 2011


On Wed, Aug 24, 2011 at 11:39 AM, Douglas Gregor <dgregor at apple.com> wrote:

>
> On Aug 21, 2011, at 9:13 PM, David Blaikie wrote:
>
> > in this case I was just
> > wondering if there was a simple tool to apply Clang's suggested
> > FixIts
>
> Have you looked at the -cc1 option "-fixit", which applies Fix-Its in
> place?
>

That's precisely what I was looking for - thanks.

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.

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))?

[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?]

Thanks,
- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110824/ca83e9f8/attachment.html>


More information about the cfe-dev mailing list