[J3] Type and kind conformance for VALUE dummy arguments
Bill Long
longb at cray.com
Thu Nov 1 17:08:52 EDT 2018
> On Nov 1, 2018, at 4:41 AM, Van Snyder via J3 <j3 at mailman.j3-fortran.org> wrote:
>
> 15.5.2.3N1 in 18-007r1 suggests that if a dummy argument has the VALUE
> attribute, the effect is as if the actual argument were assigned to a
> temporary variable, and that variable were then associated with the
> dummy argument.
But you omitted the last sentence of the Note:
"The actual mechanism by which this happens is determined by the processor.”
Which is usually that the actual argument value is passed in a register rather than the address of that value. (As strongly hinted in the first sentence of the Note, also not presented above.) In the case of a BIND(C) procedure, the passing scheme is determined by the C processor.
>
> It therefore does not appear to be necessary that the type and kind
> conform if the dummy argument is of numeric type. The rules for
> intrinsic assignment could apply.
It is not clear how it can be concluded that something appears to be the case based on a non-normative Note. But the suggested proposal seems to be promoting the idea of auto-conversion of arguments at call sites. If that is want is actually needed, then vote for the Templates proposal. That is the sensible way to accommodate multiple type/kind of actual argument for a particular dummy argument. Messing with the current argument association rules seems like a bad idea.
Cheers,
Bill
>
> Is this something we can relax?
>
>
>
Bill Long longb at cray.com
Principal Engineer, Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9143
Cray Inc./ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425
More information about the J3
mailing list