(j3.2006) Still illegal in F08?
Robert Corbett
Robert.Corbett at Sun.COM
Sat Jan 9 03:04:41 EST 2010
The person at Sun who is implementing INTENTs for pointer dummy
arguments found an apparent clash between two parts of the
standard. The text I quote here is from the Fortran 2008 FCD,
but the same text is in the Fortran 2003 standard.
Section 5.3.10, paragraph 2, page 97, states
The INTENT(IN) attribute for a pointer dummy argument
specifies that during the invocation and execution of
the procedure its association shall not be changed
except that it may become undefined if the target is
deallocated other than through the pointer (16.5.2.5).
The "except" portion of the quoted text makes it seem as if
the target of a pointer dummy argument is permitted to be
"deallocated other than through the pointer."
Section 12.5.2.13, paragraph 1, page 300 states
While an entity is associated with a dummy argument,
the following restrictions hold.
(1) Action that affects the allocation status of
the entity or a subobject thereof shall be
taken through the dummy argument.
That text seems to say that a target associated with a
pointer dummy argument can only be deallocated through the
pointer. Therefore, the "except" clause quoted above
cannot apply to a standard-conforming program. While that
is technically not a contradiction, it is unnecessarily
confusing.
Robert Corbett
More information about the J3
mailing list