TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
ASML C Coding Standard
Search

Rule:  6.5.2.1.aChecked automatically with code checker

Synopsis:Array subscripting requires a pointer to object type and one or more integral subscript expressions. The indices must be within the bounds values of the (allocated) array.
Language:C
Severity Level:1
Category:Expressions


Description:

Justification

Language constraint. To avoid memory access outside the array the index should be within the bounds of the array.

Example

int i;
int a[6];

for (i = 0; i <= 6; i++)
{
   a[i] = 0; /* WRONG: Index gets a value greater than the number of elements. */
}