Drew McCormack wrote:
> On a related issue
I don't see the relation. Pointer arguments are very different. They do indeed
work much like C pointers when used in a "pointer context" (don't ask me to
explain for lack of time :-()
> I seem to recall that in Fortran 90 the following
> code was not guaranteed to work
I don't see a reason--a is valid (i.e. associated) and points to the newly
allocated storage in setA. If b did not have the pointer attribute then the
answer would be that the pointer association status of a is undefined.
> misinterpreted the standard, and if not, has this state of affairs
> changed at all in F95 or F2000?
Pointer arguments were only midly affected (you can now have INTENT for them),
it is ALLOCATABLE ones which are new.
> type A
> real blah
> end type
>
> subroutine setA( a )
> type (A), pointer :: a
> type (A), pointer :: b
> allocate( b )
> a => b
> end subroutine
Aleksandar
|