[Bug fortran/20960] bus error for return an array
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Apr 12 00:49:00 GMT 2005
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-12 00:49 -------
Actually this is invalid code as I found out the hard way, XLC has the same issue as gfortran.
Why ICC plays so fast and lose I have no idea, oh well.
The correct way to declare the function and use it is the following (Thanks David E.):
module def
interface f
function f() result(mat)
real, dimension(3,3) :: mat
end function f
end interface
end module
program main
use def
real, dimension(3,3) :: mat
mat = f ()
print *, mat
end program
function f () result(mat)
real, dimension(3,3) :: mat
mat(1,1) = 1
end function f
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20960
More information about the Gcc-bugs
mailing list