Hi, all

My friend found a MinGW/MinGW64 Gfortran program io dead lock issue. I found that the problem is gone on Cygwin GFortran or Linux GFortran, I don't know it's related with MinGW/MinGW64 CRT or Gfortran source code. I test 4.5-4.6 series gfortran, all have this question.

The test code :

------------------------------------------------------------
!main.f90

program main
    integer :: ret
    integer :: fun1
    integer :: myfun1
    ret=fun1()
    write(*,*) ret     ! ok:)
    write(*,*) fun1() ! death!
end program

function fun1()
    integer fun1
    write(*,*)1.0
    fun1=1
    write(*,*) "fun1 end!"
end function

------------------------------------------------------------

When I use Cygwin GFortran to build it
i686-pc-cygwin-gfortran main.f90

a.exe will output
-----------------
   1.0000000
 fun1 end!
           1
   1.0000000
 fun1 end!
           1
-----------------
it works well


i686-w64-mingw32-gfortran main.f90
-----------------
   1.0000000
 fun1 end!
           1     ---> Dead here
-----------------

i686-pc-mingw32-gfortran is the same.

    May anyone look through the problem?

    Thanks.

--
Best Regards,
xunxun

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to