View Full Version : Error 2151-S: Dummy argument of procedure which changed mixed language target is inva
R. T. (Fortran Man)
09-18-2003, 08:56 PM
I am getting error 2151-S when I try to compile my mixed language program. I don't understand what the error message means.
Lahey Support
09-18-2003, 10:43 PM
This error occurs when you have a procedure that may be called in a mixed language context, and you specify an attribute for a dummy argument that requires an interface in the calling procedure.
The interface alerts the calling program to the fact that it has to send extra information to the subroutine (like the shape of an array, or the association status of a pointer). A problem occurs if the calling program is written in C or some other non-Fortran language, because they don't know about Fortran interfaces, and the extra information never gets sent. The error prevents the user from running the program and getting a segment fault, or other ragged behavior.
Some attributes of dummy arguments that might trigger this error are assumed shape for arrays, or the pointer or allocatable attributes. In general, you should not specify these attributes for dummy arguments in procedures that are being used in a mixed language context.
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.