C++ static analysis tool

F

Fredrik Eriksson

I’m responsible for the C++ developer discipline at the company I work
at, and I’m trying to shape up the quality of our code base, at least
for new developed code. Static analysis will be one step among others,
like unit test and cross compiling.

I really like the idea of an automatic check for conformance to C++
and our code style. This will mainly be used by the developer during
his/hers realization as a support, but also as a review and quality
assurance, along with unit test reports, by the project leader (or
other).

The criteria that I’m looking for is:

* Standard Conformance (this will be addressed with cross-compile, so
it’s not necessary)
* “Best practice”-checks (least amount of scope for a variable, no C-
casts and so on)
* Able to choose witch tests that will run (configure for our needs)
* Code style-checks (indentations, comments and so on).
* Able to write our own checks.

I have looked at Rose Compiler and the tool Compass. For what I can
understand it fulfills all the criteria that I’m looking for, and then
some… The only problem is that our build-, test- and production-
environment is Solaris, and Rose doesn’t seem to support Solaris, at
least as Rose is dependent on EDG, and the shipped EDG binaries is not
targeted for Solaris and Spark. I did try to build Rose anyway,
thinking I’ll sort the EDG problem later, but I could not even get
past the configure, I had to hack the configure script just to get it
to recognize that the platform was Sun Solaris, so in my book Solaris
is not supported by Rose Compiler (given that my experience with
installing these things are quite limited…)

My questions are:

Are there any others that have successfully used Rose Compiler and
Compass on Solaris?

Do you recommend any other C++ Static Analysis tool? Preferable open
source, but it will do with a proprietary also.

Thanks in advance

/Fredrik
 
V

Victor Bazarov

Fredrik said:
[..]

My questions are:

Are there any others that have successfully used Rose Compiler and
Compass on Solaris?

Why don't you ask this in a Solaris newsgroup?
Do you recommend any other C++ Static Analysis tool? Preferable open
source, but it will do with a proprietary also.

I've worked on large codebases for the last umpteen years, and not in
one place we had time or the effort to employ a tool, and not for the
lack of trying. None suited us. So we have always used peer reviews
and periodic random [ahem!] code checks against the company standards
with subsequent public flogg^H^H^H^H^Hpresentation.

V
 
I

Ian Collins

Fredrik said:
Do you recommend any other C++ Static Analysis tool? Preferable open
source, but it will do with a proprietary also.

The mark one eyeball. If you can't get by with peer review and unit
tests, you are probably in trouble.

If you want to enforce a common style, do it through a common editor
configuration.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top