This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Assumed size arrays as actual arguments
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Sat, 17 Dec 2005 20:05:57 +0100
- Subject: Assumed size arrays as actual arguments
I am in the midst of applying all the constraints and restrictions,
required by the standard, on assumed size arrays.
One feature of the standard that has me a little flumoxed is:
5.1.2.4.4 Assumed-size array
....snip....
"An assumed size array has no upper bound in its last dimension and
therefore has no extent in its last dimension and no shape. An
assumed-size array name shall not be written as a whole array reference
except as an actual argument in a procedure reference for which the
shape is not required or in a reference to the intrinsic function LBOUND."
...........
I understand perfectly what it means but cannot quite get my head around
which prodedures to apply the requirement to. At the moment, I have
required elemental procedures and array valued intrinsics to not have
such a reference in their argument expressions but have excluded all
other actual arguments. Other procedure actuals have been left alone
on the grounds that there is no way in which the compiler can determine
what goes on within the procedure. The resulting gfortran appears to
behave in the same way as Lahey and ifort(actually, it does better in
picking some manifestly wrong cases.) but that is almost certainly a
self satisfying aassertion, in the sense that I am not sure what else
applies and so have not tested it! The result breaks nothing but I have
this bad feeling that I am missing cases that should be constrained.
Richard, Brooks, or... do you have some advice to offer, please?
Cheers
Paul