This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
can this be treated as bug in fortran?
- From: Uttam Pawar <uttamp at us dot ibm dot com>
- To: fortran at gcc dot gnu dot org
- Date: Wed, 16 Nov 2005 10:27:29 -0800
- Subject: can this be treated as bug in fortran?
Hi,
I've a following case, where dangling pointer is not detected. I'll file
it as a bug report if it indeed is bug (i think it is) but still need an
opinion.
cat test2.f90
program test2
integer, pointer :: ptr1(:)
integer, pointer :: ptr2(:)
allocate(ptr1(10))
ptr1 = 10; ptr2 => ptr1
call free_ptr
ptr2 = 20
print *, "should not reach here"
contains
subroutine free_ptr
deallocate(ptr1)
end subroutine free_ptr
end program test2
May be I can do this with allocatable pointer too?
- Uttam