(j3.2006) (SC22WG5.4807) [ukfortran] WG5 letter ballot 4 on Fortran 2008 interpretations
N.M. Maclaren
nmm1
Fri Sep 28 06:13:36 EDT 2012
On Sep 28 2012, Malcolm Cohen wrote:
>>
>>F08/0067 C
>>
>>I agree that the program should not be standard conforming, and I agree
>>that the edit provided ensures that it is not. I do not agree with the
>>rationale given for the answer. Whether the invocation of SUB2 in SUB1
>>does or does not require the shape of A depends on the argument passing
>>conventions used by the processor. While all or almost all existing
>>Fortran processors use copy-in/copy-out to pass the array argument to
>>SUB2, the Fortran standard does not require a conforming processor to
>>use copy-in/copy-out. Other argument passing conventions exist that do
>>not require making a copy in this case. Those conventions do not
>>require the shape or size of A to be known.
>
> Yes, but no-one uses such a convention. (Non-polymorphic assumed-size
> arrays get passed with "stride" information, are you serious?)
Why not? The fact that no current Fortran compilers use it doesn't
mean either that it has never been used, or that it won't be in the
future.
> I mean really, one could argue that assumed-size arrays can be used
> everywhere because you never need to know the shape, you only need to
> know the stride and the location of the last element.
No, because (as you know) making that change would force current
compilers to change. It is unreasonable to require assumed-size arrays
to be passed as C-style pointers - and even more unreasonable to forbid
that.
A reasonable tweak to resolve this concern would be to change the
answer to:
The invocation of SUB2 in SUB1 allows a processor to require the
shape, and therefore the example is not standard-conforming.
Regards,
Nick Maclaren.
More information about the J3
mailing list