"Aleksandar Donev" <[log in to unmask]> wrote:
...
> >Then X=>X_PTR(B) would make X an alias for that component of B (well,
> >that's what I'd like it to do). The question is, must B have the TARGET
> >attribute?
> >
> Yes, it must. All interp 125 says (with much verbosity) is that if and
> only if both the actual and the dummy have the TARGET attribute, there
> will be no copy in/out when calling the procedure (be it subroutine or
> function), and thus pointers associated with the dummy will indeed be
> associated with the actual and vice versa. [...]
Well, I haven't read the interp, but I hope it doesn't say that. What
is should say is that the association between the pointer and the
dummy argument is preserved between the pointer and the actual
argument upon return from the procedure. So, copy-in/copy-out
is still a valid implementation, but the pointer returned must be
adjusted accordingly.
> The whole "solution" of interp 125, and in general the TARGET attribute,
> has some deficiencies, which makes this whole situation a mess. But
> don't ask me how to fix it. For now, make sure your TARGET's are
> everywhere :(
Always good advice.
--
J. Giles
|