This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/20960] bus error for return an array


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]