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

Microsoft PowerFortran & array bounds

bendel_boy1
Beginner
358 Views
We have an old program compiled with Microsoft PowerFortran. Recompiling with Intel Fortran reveals that we routinely exceeded array bounds ... Does anyone know what MSF did in this case? The lucky scenario would be if it just returned the value at the upper bound (which, fortutously, would be the 'right' value); if it took whatever lay at the requisite number of bytes above the array boundary we may be embarrassed with a client.
0 Kudos
2 Replies
Steven_L_Intel1
Employee
358 Views
The only reason you are seeing a difference is that Intel Fortran, for Debug configurations, enables array bounds checking by default, where FPS did not. If the bounds check did not occur, the result would be that it would go off into whatever memory location would be at the specified index. Prepare to be embarrassed.

Intel Fortran does a lot more checking by default, in a debug configuration, than FPS did. We believe that you'd rather find problems before your users do.
0 Kudos
bendel_boy1
Beginner
358 Views
Quoting - bendel boy
We have an old program compiled with Microsoft PowerFortran. Recompiling with Intel Fortran reveals that we routinely exceeded array bounds ... Does anyone know what MSF did in this case? The lucky scenario would be if it just returned the value at the upper bound (which, fortuitously, would be the 'right' value); if it took whatever lay at the requisite number of bytes above the array boundary we may be embarrassed with a client.

I feared that that would be the case.

I've let the project managers know that we will need to check the data files produced by this program to make sure that they are right, and flag up that the old version ignores errors

At least it's a joy that IVF is helping pick up these errors.
0 Kudos
Reply