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

I need to allow access violations

Stephen_Painchaud
2,766 Views

I am porting a very old numerical library from Solaris to the PC. My test code correctly runs under Solaris.

The authors of this code seem to make liberal use of access violations. Arrays that start with index 1 are often accessed with a negative index. I am not sure why, since the code comments are in Russian. It may seem strange that I would deal with this code, but it has unique capabilities that I can not seem to get elsewhere.

Under IVF10 I get access violations, so the code wont run. Is there any way to turn off this error for the library code?

0 Kudos
21 Replies
g_f_thomas
Beginner
429 Views
stephen.painchaud@bakerhughes.com:

I now see that I have no problems with the release version of the code.

I wouldn't bet on it.

The debug version gives the error:

forrtl: severe (408): fort: (3): Subscript #2 of the array AL has value 0 which is less than the lower bound of 1

and then crashes.

You did not get an access violation. Rather, IVF knows that your proggy caused the OS to throw an EXCEPTION_ARRAY_BOUNDS_EXCEEDED with which the compiler determines which errant index is < LBOUND and/or >UBOUND, reports, and stops compiling because it hit an error. It does not crash. This is done so that the broken code can be fixed.

An out-of-bounds array element doesn't throw an EXCEPTION_ACCESS_VIOLATION if you haven't left your namespace.

I am OK as long as I don't need to use the debugger. I originally thought I would need to, but I seem to have gotton past that point for now.

Hm! I suggest that you keep /checkbounds 'on' whatever the configuration until the program is valid. Presumably your application doesn't impact on the safety of others.

Gerry

0 Kudos
Reply