In this section:
This error is generated whenever an illegal value will be used to index an array that is being written. If this error can be detected during compilation, a compilation error will be issued instead of the normal runtime error.
Code Description Enabled Reported Platform WRITE_BAD_INDEX Writing array out of range Runtime Windows/Unix
This code attempts to access an illegal array element due to an incorrect loop range.
Other problems include
writimd3.c. A diagnosis similar to the one that follows applies to both.
Diagnosis at Runtime
- Line 2: Source line at which the problem was detected.
- Line 3: Description of the problem and the expression that is in error.
- Line 4: Illegal index value used.
- Line 5: Valid index range for this array.
- Line 6: Stack trace showing the function call sequence leading to the error.
- Line 8: Informational message indicating that a serious error has occurred which may cause the program to crash.
This is normally a fatal error and is often introduced algorithmically. Other common sources include loops with incorrect initial or terminal conditions, as in this example, for which the corrected code is the following: