Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Looking for C++ Program Analyzers (eg, "lint for C++")

Reply
Thread Tools

Looking for C++ Program Analyzers (eg, "lint for C++")

 
 
Matt England
Guest
Posts: n/a
 
      12-01-2006
I lead a large C++ development project (the open-source portion of
which can be found here: <http://svn.cleversafe.org/dscore/>), and I'm
interested in leveraging C++ "Program Analyzers" to detect problematic
code and to help condition my development team to proactively avoid
pitfalls that these tools hopefully expose.

Does anyone have any product recommendations based upon their
experience?

More details:

I see this article by Scott Meyers and Martin Klaus that appears to be
about 10 years old:

http://www.aristeia.com/ddjpaper1.html

And I wonder: what's the current state of the art?

The article above doesn't speak highly of "g++ -Wall" (which we are
currently using); maybe it's gotten better in 10 years?

Are the following tools (which I reference from the above article) or
anything else still significantly "better" than g++?

http://www.parasoft.com/jsp/products...product=Wizard
http://www.ics.com/products/centerli...ter/index.html
http://www.gimpel.com/html/lintfaq.htm
http://www.abxsoft.com/codchk.htm
http://www.programmingresearch.com/QACPP_FAMILY.htm

Specifically, I will be looking for people's experience describing
tools/products that caught real problems instead of just spewing a
bunch of errors/suggestions that end up just being busy work and not
squashing any bugs. Alas, I expect some "busy work," but I do want to
proactively kill bugs/solve problems, as well.

Thanks in advance for any help,
-Matt
Dispersed Storage: http://cleversafe.org
Remove the "downwithspammers-" text to email me.
 
Reply With Quote
 
 
 
 
Matt England
Guest
Posts: n/a
 
      12-01-2006
On Thu, 30 Nov 2006 20:55:53 -0600, I wrote:
>I'm interested in leveraging C++ "Program Analyzers" to detect problematic
>code and to help condition my development team to proactively avoid
>pitfalls that these tools hopefully expose.
>Does anyone have any product recommendations based upon their
>experience?


More details can be found here:

http://cleversafe.org/forums/viewtopic.php?t=1285

-Matt
Dispersed Storage: http://cleversafe.org
Remove the "downwithspammers-" text to email me.
 
Reply With Quote
 
 
 
 
Zara
Guest
Posts: n/a
 
      12-01-2006
On Thu, 30 Nov 2006 20:55:53 -0600, Matt England
<(E-Mail Removed)> wrote:

>I lead a large C++ development project (the open-source portion of
>which can be found here: <http://svn.cleversafe.org/dscore/>), and I'm
>interested in leveraging C++ "Program Analyzers" to detect problematic
>code and to help condition my development team to proactively avoid
>pitfalls that these tools hopefully expose.
>
>Does anyone have any product recommendations based upon their
>experience?
>

<...>>
>Specifically, I will be looking for people's experience describing
>tools/products that caught real problems instead of just spewing a
>bunch of errors/suggestions that end up just being busy work and not
>squashing any bugs. Alas, I expect some "busy work," but I do want to
>proactively kill bugs/solve problems, as well.
>


I am using pc-lint (www.gimpel.com) and I am happy with it. It has
located for me some errors the compiler would not complain of.


Zara
 
Reply With Quote
 
Mirek Fidler
Guest
Posts: n/a
 
      12-01-2006

Matt England wrote:
> I lead a large C++ development project (the open-source portion of
> which can be found here: <http://svn.cleversafe.org/dscore/>), and I'm
> interested in leveraging C++ "Program Analyzers" to detect problematic
> code and to help condition my development team to proactively avoid
> pitfalls that these tools hopefully expose.
>


In our little project (www.ultimatepp.org) there is semi-heuristic C++
parser and it was used by one of our users (Sandor Hojtsy) to implement
small GUI utility for his company that parses through C++ sources and
computes the metric to detect "overcomplicated" loops and methods.

The source code for the utility can be found here:

http://www.ultimatepp.org/examples$CodeMetric.html

for your convenience, I have placed compiled binary here:

http://www.ultimatepp.org/download/CodeMetric.zip

Maybe it will be of any use for you.

Mirek

 
Reply With Quote
 
mlimber
Guest
Posts: n/a
 
      12-01-2006
Zara wrote:
> I am using pc-lint (www.gimpel.com) and I am happy with it. It has
> located for me some errors the compiler would not complain of.


My company also uses it, and it is valuable. For instance, I had
something like this in some multithreaded code:

boost::mutex mutex;

void Foo()
{
boost::mutex::scoped_lock( mutex );
// Do protected, single-threaded stuff here
}

Of course the first line in the function should have been something
like:

boost::mutex::scoped_lock lock( mutex );

so that the lock existed through the duration of the function. The
compiler didn't complain about it (nor did my brain), but thankfully
PC-Lint did.

On the other hand, there are a number of problems with the PC-Lint, as
the forum at Gimpel.com proves. In particular, it not infrequently
generates spurious messages that take time (and sometimes support from
Gimpel) to ferret out. Still, I have not used anything better.

Cheers! --M

 
Reply With Quote
 
Mirek Fidler
Guest
Posts: n/a
 
      12-01-2006

mlimber wrote:
> Zara wrote:
> > I am using pc-lint (www.gimpel.com) and I am happy with it. It has
> > located for me some errors the compiler would not complain of.

>
> My company also uses it, and it is valuable. For instance, I had
> something like this in some multithreaded code:
>
> boost::mutex mutex;
>
> void Foo()
> {
> boost::mutex::scoped_lock( mutex );
> // Do protected, single-threaded stuff here
> }
>
> Of course the first line in the function should have been something
> like:
>
> boost::mutex::scoped_lock lock( mutex );


Little bit off-topic, but I have done this error so many times that I
rather ended with macro

void Foo() {
INTERLOCKED {
// Do protected stuff here...
}
}

Mirek

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
netflow analyzers Sven Juergensen Cisco 2 07-02-2010 10:34 AM
looking for a simple way to load a program from another python program.. Eric_Dexter@msn.com Python 10 08-15-2006 05:00 AM
Looking for a module/program author, or help with program... Kris Stark Perl Misc 1 09-08-2005 01:47 AM
Good netflow analyzers joe Cisco 7 02-23-2005 09:51 AM
IBM JVM javacore and heapdump analyzers? C B Java 0 04-13-2004 09:37 PM



Advertisments