A Free Tool to Check C/C++ Source Code Against a Set of Coding Standards

A free tool to check C/C++ source code against a set of coding standards?

The only tool I know is Vera. Haven't used it, though, so can't comment how viable it is. Demo looks promising.

What tools exist for comparing C++ code to coding guidelines?

The full list that I managed to generate:

  • PRQA's QA C++
  • Parasoft's C++Test
  • MS Visual Studio Team System seems to have some functionality but it's hard to tell via their website.
  • GrammaTech CodeSonar
  • Coverity Extend

The last two provide some functionality but not particularly customisable ones:

  • Klocwork Insight
  • Rational PurifyPlus

What open source C++ static analysis tools are available?

Oink is a tool built on top of the Elsa C++ front-end. Mozilla's Pork is a fork of Elsa/Oink.

See: http://danielwilkerson.com/oink/index.html

Coding style checker for C

The traditional beautifier indent, available on every Unix machine. The version found on some is GNU indent, which can be compiled and installed on every machine. GNU indent can read a set of rules from the file ~/.indent.pro, for instance:

--original --dont-format-first-column-comments --no-blank-lines-after-commas --parameter-indentation 8 --indent-level 8 --line-length 85 --no-space-after-parentheses --no-comment-delimiters-on-blank-lines 

So, just running indent before commiting guarantees uniformity of the presentation. If you want to enforce it, define a pre-commit hook in the Version Control System you use, which will run indent and refuse the commit if the committed version differs from what indent produces.

Is there a style checker for c++?

What about Vera++ ?

Vera++ is a programmable tool for verification, analysis and transformation of C++ source code.
Vera++ is mainly an engine that parses C++ source files and presents the result of this parsing to scripts in the form of various collections - the scripts are actually performing the requested tasks.

Click here to see a more complete demo of what it can do.

crc.hpp:157: keyword 'explicit' not followed by a single space
crc.hpp:588: closing curly bracket not in the same line or column
dynamic_property_map.hpp:82: keyword 'if' not followed by a single space
functional.hpp:106: line is longer than 100 characters
multi_index_container.hpp:472: comma should be followed by whitespace
version.hpp:37: too many consecutive empty lines
weak_ptr.hpp:108: keyword 'catch' not followed by a single space
...

A free tool to check C/C++ source code against a set of coding standards?

The only tool I know is Vera. Haven't used it, though, so can't comment how viable it is. Demo looks promising.



Related Topics



Leave a reply



Submit