--- In [email protected], "John Matthews" <[EMAIL PROTECTED]> wrote:
>
> --- In [email protected], Mickey Mathieson <user14312@> wrote:
> >
> > Has anyone used Pc-Lint by Gimpel? 
> 
> Yes- and FlexeLint, which is the Unix/Linux version.

I should add I've only used it on C, not C++.

As an example of output, I've run it on that code that had the array
access out of bounds bug in it, in message #68625:
http://tech.groups.yahoo.com/group/c-prog/message/68625

If you look carefully, lint has spotted the bug, but it's not obvious
due to all the other warnings (which as I said in my previous message
can be removed with an appropriate configuration file).

You can see that I'm running lint v8.00x, and they're now up to v9 - I
don't know what practical improvements this adds. No doubt the Gimpel
website will tell you.

FlexeLint for C/C++ (Unix) Vers. 8.00x, Copyright Gimpel Software
1985-2008

--- Module:   test.c (C)
          _
int c [30], s[30]; // statement b
test.c  16  Warning 578: Declaration of symbol 'c' hides symbol 'c'
(line 1)
test.c  16  Warning 578: Declaration of symbol 's' hides symbol 's'
(line 1)
 _
c[p] = 0;
test.c  23  Info 725: Expected positive indentation from line 21
 _
s[p] = 0;
test.c  24  Info 725: Expected positive indentation from line 21
       _
printf ("\n test : %d \n", p);
test.c  25  Info 725: Expected positive indentation from line 21
_
}
test.c  27  Warning 550: Symbol 'c' (line 16) not accessed
test.c  27  Warning 550: Symbol 's' (line 16) not accessed
test.c  27  Info 715: Symbol 'd' (line 14) not referenced
test.c  27  Info 818: Pointer parameter 'd' (line 14) could be declared as
    pointing to const
test.c  27  Warning 529: Symbol 'min' (line 19) not subsequently
referenced
test.c  27  Warning 529: Symbol 'i' (line 19) not subsequently referenced
test.c  27  Warning 529: Symbol 'coin' (line 19) not subsequently
referenced
test.c  27  Info 715: Symbol 'k' (line 14) not referenced

During Specific Walk:
  File test.c line 10: change([3], 3, 30)
test.c  23  Warning 661: Possible access of out-of-bounds pointer (1
beyond end
    of data) by operator '[' [Reference: file test.c: lines 9, 10, 21, 23]

During Specific Walk:
  File test.c line 10: change([3], 3, 30)
test.c  24  Warning 661: Possible access of out-of-bounds pointer (1
beyond end
    of data) by operator '[' [Reference: file test.c: lines 9, 10, 21, 24]

--- Global Wrap-up

Info 714: Symbol 'c' (line 1, file test.c) not referenced
Info 714: Symbol 's' (line 1, file test.c) not referenced


Reply via email to