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

Procedure pointers failing with Intel Fortran 12

Arjen_Markus
Honored Contributor II
483 Views

Hello,

we have run into a problem with procedure pointers. The attached program works with
Intel Fortran 11 (both under Windows and Linux) and fails with Intel Fortran 12 (again
it fails on both platforms).

The program will crash at the statement:

call mh_callback(level)

Can anyone shed some light on this?

Regards,

Arjen

0 Kudos
2 Replies
Steven_L_Intel1
Employee
483 Views
You are passing procedure programError as an actual argument to SetMessageHandling which declares its argument as a procedure pointer. This is not legal in Fortran 2003 but is allowed in Fortran 2008. Unfortunately, our compiler does not yet support that properly and does the wrong thing. It was previously reported here and is fixed in a future version of the compiler.

I believe that the simple fix for you is to remove the "pointer" attribute from dummy argument "callback".
0 Kudos
Arjen_Markus
Honored Contributor II
483 Views
Steve,

thanks. Remiving the pointer attribute does indeed seem to work. We were puzzled because it
did work with Intel Fortran 11 (but that version may simply ignore the pointer attribute).

Regards,

Arjen
0 Kudos
Reply