This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: A tale of three compilers
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Paul Thomas <paulthomas2 at wanadoo dot fr>
- Cc: fortran at gcc dot gnu dot org
- Date: Sat, 04 Dec 2004 20:03:43 +0100
- Subject: Re: A tale of three compilers
- References: <001a01c4d207$477fac10$0400000a@Paul> <200411241302.06960.paul@codesourcery.com> <001401c4da2c$d00485b0$0400000a@Paul>
Paul Thomas wrote:
> module global
> type :: mytype
> type(mytype),pointer :: this
> end type mytype
> type(mytype),target :: base
> end module global
> program test_equi
> use global
> call check()
> print *, "base%this%this=>base?" , associated(base%this%this,base)
> print *, "base%this%this=>?" , associated(base%this%this)
> print *, "base%this=>?" , associated(base%this)
> contains
> subroutine check()
> type(mytype),target :: j
> base%this => j !have the variables point
> j%this => base !to one another
> end subroutine check !take j out of scope
> end program test_equi
See note 14.13 and paragraph 14.6.2.1.3 no. 3 in the Fortran 95 standard. The
status of base%this is undefined after leaving the subroutine.
HTH
- Tobi