views:

595

answers:

5

There exist tools for comparing code against a custom specified set of coding guidelines/standards for a variety of languages (rather than pure static analysis for common defects). Examples include FxCop for .Net code and CheckStyle for Java, but I was wondering what examples people know of in the C++ world.

An existing question was asked regarding free tools which provided examples like Vera but I was also wondering about commercial tools that may be available.

+1  A: 

astyle is a common Unix tool that reformats source to a specified style. It supports most C-like languages. I know of no similar commercial tools.

greyfade
I think the question is more about idioms and variable names than indentation and newlines.
Ryan Graham
+1  A: 

I was also wondering about commercial tools that may be available.

Visual Studio Team System Edition 2005/2008 does have some such stuff. They also have a facility to enforce a set of rules on a whole team. Check it out.

dirkgently
+3  A: 

A tool used by us was CodeWizard from Parasoft. But I think the new version is called "Parasoft C++ Test". From the homepage:

  • Static analysis of code for compliance with user-selected coding standards
  • Graphical RuleWizard editor for creating custom coding rules
  • Static code path simulation for identifying potential runtime errors
  • Automated code review with a graphical interface and progress tracking
  • Automated generation and execution of unit and component-level tests
  • Flexible stub framework
  • Full support for regression testing
  • Code coverage analysis with code highlighting
  • Runtime memory error checking during unit test execution
  • Full team deployment infrastructure for desktop and command line usage
BtD
+1  A: 

DISCLAIMER: Working on this tool is my day job.

I'm obviously biased, but one of the main features of QA C++ is Coding Standard enforcement. For example we do JSF++ and MISRA C++ enforcement. You can read more about this here.

Richard Corden
This answer is relevant, and I believe plugging your IP is acceptable when this is relevant to the question. See this question http://meta.stackoverflow.com/questions/741/what-is-the-most-appropriate-way-to-promote-yourself-using-stackoverflow/756#756 some discussion on this point.
ConcernedOfTunbridgeWells
+3  A: 

The full list that I managed to generate:

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

dlanod