Bill Davy
10/15/2008 9:30:00 AM
I use PC-Lint from www.gimpel.com and yes, it finds bugs and tightens up
code.
One thing which is often forgotten is that when maintaining a program, it is
useful if things clearly have the minimum coupling. Lint points out when
things can be made static or const or moved out of a header, which is not
the job of a compiler. This helps writers produce the least coupling. As
maintenance is more important and difficult than writing code (and why write
"code", not software), writers should have to produce clean Lint runs before
saying their "code" is done.
Well, that's my opinion.
Bill
PS And yes, I do "really stupid things" but I feel admitting it is a sign of
maturity.
"James Kanze" <james.kanze@gmail.com> wrote in message
news:971b700c-1d26-4ef2-b81e-8051db2d64f1@v16g2000prc.googlegroups.com...
On Oct 14, 2:29 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
> Carfield Yim <carfi...@gmail.com> writes:
> > I get the error saying that
> > lint: file with unknown suffix ignored: XXX.cpp
> > How can I deploy some kind of static checking to CPP application?
> Yes, but not with lint.
There are versions of lint which can handle C++ (but I'm not
sure that they're called lint---maybe lint++).
> There are tools specifically targetted at C++.
> For example, lint++ :
> alias lint++='g++ -o /dev/null -c -pedantic -Wall -Werror -W'
That doesn't begin to do everything that lint does. Link looks
at the entire program.
In my experience, however, it's not really necessary for C++,
unless you have people doing really stupid things. So g++ does
nore or less do the job (with the appropriate options). But
given that, there's no real reason not to generate code while
you're at it.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34