(j3.2006) Targets
Malcolm Cohen
malcolm
Mon Jan 18 06:25:12 EST 2010
Bill Long wrote:
> At [296:32-34] we say that, if the dummy is a pointer and the actual is not,
> then the actual argument shall be "a valid target for the dummy pointer in a
> pointer assignment statement". I don't think we mean that literally.
Actually, we do.
> Clearly, we intend to require that some of the rules for pointer assignment
> apply, such as that the actual argument has valid type, rank, and kind
> parameters for the assignment. But another requirement for a pointer
> assignment - that the target be visible in the current scope, is clearly not
> the case here.
I don't see that rule written down anywhere.
Maybe you mean that you cannot literally write such a pointer assignment because
there isn't a name available that gets you to the target. That might be true,
but I don't think that doesn't make the target not a "valid target.
There isn't a BNF term <target> any more, so there shouldn't be any confusion on
that score.
In particular, if there just happened to be a globally visible pointer around
with the same attributes as the actual argument and the same target, we'd be
able to write such a pointer assignment. Saying something has to be a valid
target in a pointer assignment cannot conceivably depend on the association
status of some unrelated pointer.
> Since the statement is partially conceptual, it is not so clear whether the
> actual has to have the TARGET attribute, though that requirement is clearly
> desirable.
I think it is clear enough: we made that statement specifically because we
wanted to bring in all the "rules" from the pointer assignment statement.
TARGET is the *least* of them.
> We do say it at [510:6], but that is not normative text.
> It seems sufficiently important to say here as well.
Absolutely not - if we said that explicitly here, that would mean the *other
rules* would also need to be restated otherwise we would be implying that they
did not apply. That was absolutely not the intent. There are many rules for
what it means to be a valid target in a pointer assignment (in fact the number
of rules has grown from when we put that text in) - and we did not want to list
all the ones at a particular point in time since that would be a hostage to
fortune (which in the event would in fact have caused the standard to become
broken). For example, we absolutely want the target to be on the same image as
the pointer, we absolutely want the target to be contiguous if the pointer is
CONTIGUOUS.
Maybe it could be stated a bit more clearly, but I don't think this is broken.
I don't see any obvious "fix" that doesn't make things worse, either (if someone
else has a bright idea, feel free). Next time around maybe we can do some work
on clarifying it, but I'd rather not start changing this now because I think the
chance of error would be much too high.
Cheers,
--
................................Malcolm Cohen, Nihon NAG, Tokyo.
More information about the J3
mailing list