Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

WriteFile /integer_size:64 crash on Win32

$
0
0

Using a program like this:

 

      program main
      call crash()
      end program
      
      
      subroutine crash()
      use kernel32
      integer(HANDLE) hFile
      integer(DWORD) iSize
      integer(DWORD) iSizeRW
      integer iTotalSize,iTotalSizeRW
      integer(BOOL) iResult
      
      iTotalSize=78439242
      hFile=0
      iSize = sizeof(iTotalSize)
      iResult = 1
      iSizeRW = iSize
      iResult=WriteFile(hFile,loc(iTotalSize),iSize,loc(iSizeRW),NULL)
      end subroutine
      

With /integer_size:64 (and only on the Win32 platform), and using ifort 2015 Update 4, at the end of subroutine crash(), I get ebp-esp = 4, and the error message:

Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

 

So ... what did I mess up now?


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>