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

David Blaikie dblaikie at gmail.com
Fri Aug 26 13:43:26 PDT 2011


On Fri, Aug 26, 2011 at 1:23 PM, Chris Lattner <clattner at apple.com> wrote:

>
> On Aug 26, 2011, at 10:38 AM, Douglas Gregor wrote:
>
> It seems like it would be pretty limiting to be entirely agnostic to
> 'better' ways of doing things until the old way is explicitly deprecated by
> the standard.
>
>
> This is an intentional and desirable limitation. A compiler is not a style
> checker, nor should it ever be.
>
>
> I completely agree.  Is anyone interested in working on a clang plugin that
> does style checks?  That would be hugely useful for a  wide variety of
> purposes!
>

Moderately - I'm just reading
http://code.google.com/p/chromium/wiki/WritingClangPlugins now (is there a
better place to get an overview of clang plugin mechanisms/writing) to get a
feel for what clang plugins can do.

But basically you can write something that, when an extra argument is passed
to the compiler, it can emit extra warnings/diagnostics/fixits/etc, just as
though they were first class citizens of the compiler? (eg: instead of
passing "-Wnullptr" I'd pass "-plugin nullptr" (or more generally, a style
plugin then with its own arguments about whether it enforced nullptr
styling, line length styling, braced/unbraced blocks, etc) or something
equivalent?)

- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110826/35e25d99/attachment.html>


More information about the cfe-dev mailing list