<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Stack address not properly saved across function call. in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Stack-address-not-properly-saved-across-function-call/m-p/985900#M27116</link>
    <description>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: &lt;BR /&gt; &lt;BR /&gt;The value of ESP was not properly saved across a function call. ... &lt;BR /&gt; &lt;BR /&gt;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. &lt;BR /&gt; &lt;BR /&gt;The C declaration is: &lt;BR /&gt;extern "C" &lt;BR /&gt;{ &lt;BR /&gt;   void XFERCONS_C_SCISIM( double J1[], &lt;BR /&gt;                      double C1[], &lt;BR /&gt;                      double C2[], &lt;BR /&gt;                      double L1[], &lt;BR /&gt;                      double M2[], &lt;BR /&gt;                      double U1[], &lt;BR /&gt;                      double U2[] ); &lt;BR /&gt;} &lt;BR /&gt; &lt;BR /&gt;The C call is: &lt;BR /&gt;void TCII_SCISIM_Interface::CALL_XFERCONS( &lt;BR /&gt;                  double J1[], &lt;BR /&gt;                  double C1[], &lt;BR /&gt;                  double C2[], &lt;BR /&gt;                  double L1[], &lt;BR /&gt;                  double M2[], &lt;BR /&gt;                  double U1[], &lt;BR /&gt;                  double U2[] ) &lt;BR /&gt;{ &lt;BR /&gt;   // note that arguments are addresses of parameters &lt;BR /&gt;   XFERCONS_C_SCISIM( J1, C1, C2, L1, M2, U1, U2 ); &lt;BR /&gt;} &lt;BR /&gt; &lt;BR /&gt;The Fortran subroutine is: &lt;BR /&gt;      SUBROUTINE XFERCONS_C_SCISIM (  J1, &lt;BR /&gt;     .                           C1, &lt;BR /&gt;     .                           C2, &lt;BR /&gt;     .                           L1, &lt;BR /&gt;     .                           M2, &lt;BR /&gt;     .                           U1, &lt;BR /&gt;     .                           U2) &lt;BR /&gt;      REAL*8   J1(MAX_NUM_CONSTANTS) &lt;BR /&gt;      REAL*8   C1(MAX_NUM_CONSTANTS) &lt;BR /&gt;      REAL*8   C2(MAX_NUM_CONSTANTS) &lt;BR /&gt;      REAL*8   L1(MAX_NUM_CONSTANTS) &lt;BR /&gt;      REAL*8   M2(MAX_NUM_CONSTANTS) &lt;BR /&gt;      REAL*8   U1(MAX_NUM_CONSTANTS) &lt;BR /&gt;      REAL*8   U2(MAX_NUM_CONSTANTS) &lt;BR /&gt; &lt;BR /&gt;      INTEGER*4   I &lt;BR /&gt; &lt;BR /&gt;      DO I = 1,MAX_NUM_CONSTANTS &lt;BR /&gt;         J1CON(I) = J1(I) &lt;BR /&gt;         C1CON(I) = C1(I) &lt;BR /&gt;         C2CON(I) = C2(I) &lt;BR /&gt;         L1CON(I) = L1(I) &lt;BR /&gt;         M2CON(I) = M2(I) &lt;BR /&gt;         U1CON(I) = U1(I) &lt;BR /&gt;         U2CON(I) = U2(I) &lt;BR /&gt;      ENDDO &lt;BR /&gt; &lt;BR /&gt;      END &lt;BR /&gt; &lt;BR /&gt;Any help with solving this issue will be greatly appreciated. &lt;BR /&gt; &lt;BR /&gt;Thanks, &lt;BR /&gt;George</description>
    <pubDate>Sun, 10 Mar 2002 06:01:01 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2002-03-10T06:01:01Z</dc:date>
    <item>
      <title>Stack address not properly saved across function call.</title>
      <link>https://community.intel.com/t5/Software-Archive/Stack-address-not-properly-saved-across-function-call/m-p/985900#M27116</link>
      <description>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: &lt;BR /&gt; &lt;BR /&gt;The value of ESP was not properly saved across a function call. ... &lt;BR /&gt; &lt;BR /&gt;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. &lt;BR /&gt; &lt;BR /&gt;The C declaration is: &lt;BR /&gt;extern "C" &lt;BR /&gt;{ &lt;BR /&gt;   void XFERCONS_C_SCISIM( double J1[], &lt;BR /&gt;                      double C1[], &lt;BR /&gt;                      double C2[], &lt;BR /&gt;                      double L1[], &lt;BR /&gt;                      double M2[], &lt;BR /&gt;                      double U1[], &lt;BR /&gt;                      double U2[] ); &lt;BR /&gt;} &lt;BR /&gt; &lt;BR /&gt;The C call is: &lt;BR /&gt;void TCII_SCISIM_Interface::CALL_XFERCONS( &lt;BR /&gt;                  double J1[], &lt;BR /&gt;                  double C1[], &lt;BR /&gt;                  double C2[], &lt;BR /&gt;                  double L1[], &lt;BR /&gt;                  double M2[], &lt;BR /&gt;                  double U1[], &lt;BR /&gt;                  double U2[] ) &lt;BR /&gt;{ &lt;BR /&gt;   // note that arguments are addresses of parameters &lt;BR /&gt;   XFERCONS_C_SCISIM( J1, C1, C2, L1, M2, U1, U2 ); &lt;BR /&gt;} &lt;BR /&gt; &lt;BR /&gt;The Fortran subroutine is: &lt;BR /&gt;      SUBROUTINE XFERCONS_C_SCISIM (  J1, &lt;BR /&gt;     .                           C1, &lt;BR /&gt;     .                           C2, &lt;BR /&gt;     .                           L1, &lt;BR /&gt;     .                           M2, &lt;BR /&gt;     .                           U1, &lt;BR /&gt;     .                           U2) &lt;BR /&gt;      REAL*8   J1(MAX_NUM_CONSTANTS) &lt;BR /&gt;      REAL*8   C1(MAX_NUM_CONSTANTS) &lt;BR /&gt;      REAL*8   C2(MAX_NUM_CONSTANTS) &lt;BR /&gt;      REAL*8   L1(MAX_NUM_CONSTANTS) &lt;BR /&gt;      REAL*8   M2(MAX_NUM_CONSTANTS) &lt;BR /&gt;      REAL*8   U1(MAX_NUM_CONSTANTS) &lt;BR /&gt;      REAL*8   U2(MAX_NUM_CONSTANTS) &lt;BR /&gt; &lt;BR /&gt;      INTEGER*4   I &lt;BR /&gt; &lt;BR /&gt;      DO I = 1,MAX_NUM_CONSTANTS &lt;BR /&gt;         J1CON(I) = J1(I) &lt;BR /&gt;         C1CON(I) = C1(I) &lt;BR /&gt;         C2CON(I) = C2(I) &lt;BR /&gt;         L1CON(I) = L1(I) &lt;BR /&gt;         M2CON(I) = M2(I) &lt;BR /&gt;         U1CON(I) = U1(I) &lt;BR /&gt;         U2CON(I) = U2(I) &lt;BR /&gt;      ENDDO &lt;BR /&gt; &lt;BR /&gt;      END &lt;BR /&gt; &lt;BR /&gt;Any help with solving this issue will be greatly appreciated. &lt;BR /&gt; &lt;BR /&gt;Thanks, &lt;BR /&gt;George</description>
      <pubDate>Sun, 10 Mar 2002 06:01:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Stack-address-not-properly-saved-across-function-call/m-p/985900#M27116</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2002-03-10T06:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Stack address not properly saved across function call.</title>
      <link>https://community.intel.com/t5/Software-Archive/Stack-address-not-properly-saved-across-function-call/m-p/985901#M27117</link>
      <description>Add __stdcall after the "C" in your C (actually C++) declaration.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Sun, 10 Mar 2002 12:22:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Stack-address-not-properly-saved-across-function-call/m-p/985901#M27117</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2002-03-10T12:22:49Z</dc:date>
    </item>
  </channel>
</rss>

