[J3] Vector subscripts and INTENT(INOUT)
Bill Long
longb at cray.com
Thu May 17 12:19:28 EDT 2018
> On May 15, 2018, at 7:08 PM, Malcolm Cohen via J3 <j3 at mailman.j3-fortran.org> wrote:
>
> > I did go back and look at old standards. F2008, in the “Vector
> > subscript” subclause of 6, has “An array section with a vector
> > subscript shall not be argument associated with a dummy array that
> > is defined or redefined.”. That is the “shall not” rule that
> > supports the factual claim in the argument association clause that
> > the dummy is undefinable.
>
> Actually, the rule stating that the dummy is undefinable is correct and sufficient. It is a rule. Stating that the dummy is not definable ***MAKES IT NOT DEFINABLE***. It is not an idle observation but normative text!
>
> > I fully support putting the rule back in F2018 draft.
>
> The correct rule is already there: the dummy is not definable. XL Fortran is reporting a different rule violation, and that separate rule is also still there.
>
> > (Or if there is good reason for dropping it, I would appreciate learning it.)
>
> Yes, it depends on using a time machine. That’s always a bad idea.
>
> That is, the “shall not be argument associated” rule cannot be applied because its application is at argument association time, but the condition “dummy array is defined or redefined” occurs (or does not occur) in the future.
>
> You won’t be getting any rules that require time travel reinserted into the standard.
The current text (that is claimed to be correct)
“If … the actual argument is an array section having a vector subscript, the dummy argument is not definable”
also appears to have a timing characteristic - depending on an argument association action that then makes the dummy argument not definable. I assume the intent is that WHILE the argument association is in effect, the dummy is not definable. And that a different reference to the same procedure with a named array as the actual argument does not carry the requirement that the dummy be not definable.
This seems like more effort than is justified just to avoid a requirement that the dummy have the VALUE or INTENT(IN) attribute. Admittedly that change is a backward incompatibility, but one that would affect very few actual codes (outside compiler test suites).
Cheers,
Bill
>
> Cheers,
> --
> ..............Malcolm Cohen, NAG Oxford/Tokyo.
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