Drew McCormack wrote:
> Can you pass a non-target variable to a subroutine where it is defined
> to have the target attribute?
Yes. But there is a caveat. Your program is not standard conforming
because the actual argument does not have the target attribute. It is
allowed for the dummy argument to have the target attribute when the
actual argument does not, but any pointers associated with that dummy
argument become (officially) undefined when the procedure returns.
The implementation doesn't usually change the pointer, so its undefined
state is not detectable. It would, however, point to the wrong place if
the argument was passed as copy-in/copy-out instead of call by reference.
The pointer remains defined if the actual argument does have the target
attribute.
--
J. Giles
|