Tue, 3 Sep 2002 16:01:07 in microsoft.public.vc.language, "David Crow
Quote:
>I used many years ago with 16-bit development. It had good info.
>> Anyone have any first-hand experience with Gimpel's PC-Lint (or any
>> alternatives?) I've been thinking about getting it, but would like to
>hear
>> any feedback before I plunk down $240.00 I can ill-afford to spend. I'm
>> thinking it will be useful for tightening up my code.
>> Thanks!
>> C.
>> (to reply via email, remove the 'NS' in the address)
I have been using the product for more than 10 years.
I use it for C; I have little experience of using it with C++.
I am a Beta tester and no longer pay money for the product.
I find it ESSENTIAL. It takes time to get the best from it. The
demonstration below shows a class of error I used to have.
c:\WFB> cl -nologo -W4 badscan.c
badscan.c
c:\WFB> type badscan.c
/*
* badscan.c - scanf argument inconsistency demonstration
*/
#include <stdio.h>
int main(void) {
int i = 0;
scanf("%i", i);
printf("%d");
return 0;
Quote:
}
c:\WFB> cl -nologo -W4 badscan.c
badscan.c
c:\WFB> lin badscan
c:\WFB> c:\lint\lint-nt +v -ic:\lint\ std.lnt c:\wfb\bin\c0-delta.lnt
+os(_lint.tmp) badscan
PC-lint for C/C++ (NT) Ver. 8.00g, Copyright Gimpel Software 1985-2002
--- Module: badscan.C
c:\lint\lint-nt +v -ic:\lint\ std.lnt c:\wfb\bin\c0-delta.lnt
+os(_lint.tmp) badscan
--- Module: badscan.C
scanf("%i", i);
^
badscan.C(10) : Warning 560: argument no. 2 should be a pointer
printf("%d");
^
badscan.C(11) : Warning 558: Too few arguments for format (1 missing)
Quote:
}
^
badscan.C(13) : Note 953: Variable 'i' (line 8) could be declared as
const
---
PC-lint for C/C++ output placed in _LINT.TMP
c:\WFB>
There are free alternatives; splint from http://www.splint.org is one.
Earlier this year, I put a lot of work into using it as I was hoping
that its function semantic descriptions would give me benefits
additional to those from PC-Lint. I found it unreasonably difficult to
silence the spurious diagnostics. There is a code corresponding to each
diagnostic which suppresses that diagnostic. PC-Lint uses error numbers
and supports wild cards for diagnostic suppression. For example, I could
(perversely) suppress the warnings above with lin -e5* badscan
YMMV. Look further before spending your 240USD at http://www.gimpel.com
--
Walter Briscoe