More about bounds checking

More about bounds checking

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?

Download test16.f90432 bytes
3 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

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.

imagem de Steve Lionel (Intel)

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.


Faça login para deixar um comentário.