Ok John, you've got me curious. I haven't developed in C since I left NASDAQ in 98, so my memories of using PC-Lint are sketchy at best. My ego wants to say that the 'modern' compilers are in a state that outside checking tools aren't necessary, but since I'm theoretically older and more mature, I think I'll download PC-Lint and play a little.
and of course, no compiler or tool can check access of the end of arrays.... I think :) Michael Comperchio [email protected] On Mar 6, 2009, at 8:54 AM, John Matthews wrote: > --- In [email protected], Michael Comperchio <mcmp...@...> wrote: > > > > Would lint have caught my silly typo? > > It does detect attempts to access beyond the end of arrays it knows > the size of, but unfortunately in this case it doesn't know the size > of argv[]. > > I take it you haven't used PC-Lint (or FlexeLint for Linux/Unix etc.) > - if you had, you would know that your program which compiles with no > warnings of any sort can generate pages and pages of lint warnings. > > Of course most are probably harmless, but it's quite possible that > after turning off the 'less likely to be bugs' warnings you'll end up > with some that are. Accesses off the end of arrays for example - I'm > pretty sure gcc doesn't check for those, although I don't know what > the current Windows compilers are like. > > John > >
