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

Fons Rademakers Fons.Rademakers at cern.ch
Wed Jun 23 09:36:55 PDT 2010


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

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



More information about the cfe-dev mailing list