[cfe-dev] C++ coding rules checker...

Nick Lewycky nlewycky at google.com
Wed Jun 23 11:33:01 PDT 2010


On 23 June 2010 09:36, Fons Rademakers <Fons.Rademakers at cern.ch> wrote:

> Hi,
>
>   we use in our C++ project a set of coding rules, like:
>
> - class names have to start with T
> - POD structs have to end with _t
> - data members have to start with f followed by upper case letter
> - static data members have to start with fg followed by upper case letter
> - ...
>
> Currently we use a third party code checker written in java, with each rule
> written as a small java class. The parser is not a full C++ parser, etc.
> Anyway, this seems like an ideal problem where clang/llvm could be the
> solution. Has somebody already developed such a checker using Clang? If yes
> can we use and modify it? If not, what would be the best way to build such
> a code checker, starting with adding rules to the clang-analyzer, as it has
> the interface we would like too (drop-in in the Makefile and outputting
> html files)?
>

This sounds like it should be possible today. The convention checker in
lib/Checker/LLVMConventionsChecker.cpp which may give you some ideas.

Nick


>
> Cheers, Fons.
>
> --
> Org:    CERN, European Laboratory for Particle Physics.
> Mail:   1211 Geneve 23, Switzerland
> E-Mail: Fons.Rademakers at cern.ch              Phone: +41 22 7679248
> WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100623/4affb2b0/attachment.html>


More information about the cfe-dev mailing list