I have C++ code that calls a few Fortran routines. (Legacy software that can not be rewritten into C++.) I am getting the following runtime error:
The value of ESP was not properly saved across a function call. ...
I am assuming that this is coming from one of my Fortran subroutine calls. I get the message when I return from the subroutine. I see nothing wrong with the declarations and definitions. I've gotten other Fortran subroutines to function with no warnings or errors. The code functions correctly when I stepped into it and examined variable values.
The C declaration is:
void XFERCONS_C_SCISIM( double J1,
double U2 );
The C call is:
double U2 )
// note that arguments are addresses of parameters
XFERCONS_C_SCISIM( J1, C1, C2, L1, M2, U1, U2 );
The Fortran subroutine is:
SUBROUTINE XFERCONS_C_SCISIM ( J1,
DO I = 1,MAX_NUM_CONSTANTS
J1CON(I) = J1(I)
C1CON(I) = C1(I)
C2CON(I) = C2(I)
L1CON(I) = L1(I)
M2CON(I) = M2(I)
U1CON(I) = U1(I)
U2CON(I) = U2(I)
Any help with solving this issue will be greatly appreciated.