[cfe-dev] How to control C++0x adoption in a large codebase?

David Blaikie dblaikie at gmail.com
Thu Oct 13 20:32:44 PDT 2011


>
> Style checking belongs in a plug-in. That way, different organizations can
> provide their own style checkers that run along with their builds without
> forcing the union of all styles into the mainline Clang front-end. Better
> yet, maybe someone will build a configurable style checker as a plugin, to
> save the effort of everyone having to implement their own plugin separately.
>

This is certainly something I'd like to get going if/when I get the
time/familiarity (or if someone beats me to it, I'd be more than willing to
contribute). Style checker & auto-fixer, of course (astyle with teeth?).


> I'd like to hear more opinions on whether others consider the proposed
> warnings to be coding style enforcement, or whether they are generally
> useful.
>

I tend to agree - I think the right feature for the compiler here is instead
to make it easy to ensure that while you continue to write C++03 you don't
write it in such a way that it won't be sensible C++11 and I believe Clang
already has some such warnings in C++03 mode about use of identifiers or
features that might cause problems if the code were compiled as C++11
(correct me if I'm wrong there - if Clang doesn't have such behavior I think
it would be a reasonable thing to add). Rather than supporting a strange (&
as you point out, off by default) mode of compiling C++11 without any C++11
features. By supporting warnings in C++03 mode it's also less likely that it
will be construed as complete/accurate support - the warnings are a best
effort to ease your portability up to C++11, but nothing, short of compiling
(& testing) the code in both modes, is going to get you all the way there.

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


More information about the cfe-dev mailing list