[Bug fortran/45337] intent(out) and pointer => null()

linuxl4 at sohu dot com gcc-bugzilla@gcc.gnu.org
Thu Aug 19 09:14:00 GMT 2010



------- Comment #1 from linuxl4 at sohu dot com  2010-08-19 09:14 -------
module ptrmod
contains
subroutine lengthX(x, i)
   implicit none
   real, pointer, intent(out) :: x(:)=>null()
   integer :: i
   allocate(x(i))
   x=i
end subroutine
end module

program main
  use ptrmod
  implicit none
  real, pointer :: x(:)
  integer :: i
  do i=1,5
     call lengthX(x, i)
     print *, size(x), x
  enddo
  if(associated(x)) deallocate(x)
  x=>null()
end program


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45337



More information about the Gcc-bugs mailing list