Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

More about bounds checking

WSinc
New Contributor I
677 Views

In this test program, I can input a negative row number,

and it happily does not care whether its within the bounds

of the array A (in the calling routine), but then when I input a

negative COLUMN number, it generates a breakpoint.

Notice that I can print out quantities that are OUTSIDE the calling

routine array A, just by giving a large number of columns or rows.

Anyway, isn't it supposed to do bounds checking on BOTH columns and rows?

A negative row number is this context should be caught shouldn't it?

(Virus scan in progress ...)
0 Kudos
2 Replies
TimP
Honored Contributor III
677 Views

I think you have your row and column designations backward from usual Fortran convention.  The bounds checking probably doesn't care if you stay inside the array even though you exceed one of the subscripts, as it has to allow the case where a multiple dimensioned array is accessed as single dimensioned.

0 Kudos
Steven_L_Intel1
Employee
677 Views

When you say *, it's up to you to make sure you don't go out of bounds. The compiler has no idea what the actual bounds are.  This is why you should use : (and explicit interfaces) instead.

0 Kudos
Reply