Currently, this is a limitation of Splint.  Right now we only try to detect array 
accesses in which the index is greater than the maximum allowable value.  We do not 
currently try to detect cases in which the index is less than the minimum safe value.

We didn't include this type of checking because reads beyond the end of an array are a 
more common problem and checking for reads before the bringing of an array tended to 
produce large numbers of false positives.

We'll look into adding some type of functionality to detect reads before the bringing 
of an array in a future release.

On Tue, Oct 08, 2002 at 04:44:47PM +0200, Argenton Paolo wrote:
> Hi all,
> I was just playing around with splint and typed in the following code
> fragment:
>   int a[ 10 ];
>   a[ 10 ] = 0; /* this is correcty detected */
>   a[ -1 ] = 0;  /* this is NOT detected */
> where am I wrong ? is it a Splint flaw ?
> thanks
> Paolo

Reply via email to