--- In [email protected], Michael Comperchio <mcmp...@...> wrote:
>
> and of course, no compiler or tool can check access of the end of 
> arrays.... I think :)

static int table[] = {1, 2, 3, 4, 5};

int main(void)
{
    int i, sum;

    for (sum = i = 0; i <= 5; i++)
    {
        sum += table[i];
    }

    return sum;
}

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

--- Module:   jm.c (C)
                       _
        sum += table[i];
jm.c  9  Warning 661: Possible access of out-of-bounds pointer (1 beyond end of
    data) by operator '[' [Reference: file jm.c: lines 7, 9]
jm.c  7  Info 831: Reference cited in prior message
jm.c  9  Info 831: Reference cited in prior message

Reply via email to