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?

Fichier attachéTaille
Télécharger test16.f90432 octets
3 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

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.

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.

Steve - Intel Developer Support

Connectez-vous pour laisser un commentaire.