Subclause 12.4.1.1 of the Fortran 95 standard states (starting at line
45 on page 200) that if a dummy argument has explicit shape or assumed
size and the TARGET attribute, and the associated actual argument has the
TARGET attribute, it is processor-dependent whether any pointers associated
with the dummy argument remain associated with the actual argument after
the procedure completes.
One reason I can imagine that a pointer associated with a dummy argument
would not remain associated with a corresponding actual argument is
that the processor was required to make a copy of the actual argument
in order to meet the uniform-stride requirements of an explicit-shape
or assumed-size dummy argument.
Would it cause a hardship for any compiler developer if the paragraphs
at lines 38-44 on page 200 of the Fortran 95 standard, that read
If the dummy argument has the TARGET attribute and is either a scalar
or an assumed-shape array, and the corresponding actual argument has
the TARGET attribute but is not an array section with a vector subscript
(1) Any pointers associated with the actual argument become associated
with the corresponding dummy argument on invocation of the procedure
and
(2) When execution of the procedure completes, any pointers associated
with the dummy argument remain associated with the actual argument.
were changed to read
If (1) the dummy argument has the TARGET attribute and is either a scalar
or an assumed-shape array, and the corresponding actual argument has
the TARGET attribute but is not an array section with a vector subscript,
or (2) the dummy argument has the TARGET attribute and is an explicit-
shape or assumed-size array, and the corresponding actual argument is a
rank-1 array that has the TARGET attribute but is not an array section
with a vector subscript
(1) Any pointers associated with the actual argument become associated
with the corresponding dummy argument on invocation of the procedure
and
(2) When execution of the procedure completes, any pointers associated
with the dummy argument remain associated with the actual argument.
or something differently worded that has the same effect?
(This would also require putting "Otherwise" before the "If" at line
45 on page 200.)
--
What fraction of Americans believe | Van Snyder
Wrestling is real and NASA is fake? | [log in to unmask]
Any alleged opinions are my own and have not been approved or disapproved
by JPL, CalTech, NASA, Dan Goldin, Bill Clinton, the Pope, or anybody else.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|