[previous] 2841 [next] Definite: Dereference of an invalid pointer value.
Arrays

A definite anomaly has been detected. Examination of the context indicates that this expression will always result in an access outside the bounds of an array.

For example


/*PRQA S 2017,3120,3132,3203,3227,3408,3605 ++*/
void foo(int n)
{
    int a[10];

    if (n > 10)
    {
        a[n] = 1;               /* 2841 */
    }
}


MISRA C:2012 Rules applicable to message 2841:

Dir-4.1  (Required) Run-time failures shall be minimized


See also:

QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents