"Aleksandar Donev" <[log in to unmask]> wrote:
...
> The question is, can two TARGET INTENT(OUT) dummy array assumed-shape arguments
> be aliased to one another, when the actuals are arrays sections and also have
> TARGET attribute. As I am reading the standard, the answer is yes. And I don't
> like this answer (and others seem to agree or disagree, of course :). So no
> POINTERs involved...
Well, even as I read the standard with the interps thrown in, I still
calim the answer is no: two target attributed variables may not be
aliased (if one of them is defined, redefined, or becomes undefined).
There are two problems with the wording on the standard with respect
to this issue. First, it is phrased in a peculiar kind of double-negative.
The effect is like you've said "for no x can property P hold, unless ..."
Well, the negation of "for no x" is not "for all x", but is rather "for some
x".
The second problem is that there is an attempt to make aliasing an
individual property of each dummy argument. Well, a single argument
may be not-aliased, but it takes two to be aliased. For arguments that
may not be aliased, even the peculiar double-negative form of presentation
suffices. But for arguments that are allowed to be aliased, the standard
needs to present the issue in a direct and positive manner. What,
specifically, may be aliased to what? Things that are not defined
(redefined, become undefined) can be aliased. That's always been
allowed and is probably the reason for the strange double-negative
form being adopted in the first place.
If an entity is defined (redefined, becomes undefined), and the name
through it is changed is a pointer, then it may still be referenced though
another name provided that other is a pointer or a target. If the name
through which the entity is changed is a target, then it may still be
referenced through another name that is a pointer. If the name through
which the entity is changed is neither a target nor a pointer, it may
not be referenced though any other name.
I think this is the actual intent of the long-winded wording in the standard.
is there a disagreement with this?
--
J. Giles
|