[J3] Vector subscripts and INTENT(INOUT)

Steve Lionel steve at stevelionel.com
Thu May 17 12:23:07 EDT 2018

Please make sure you send to j3 at mailman.j3-Fortran.org and not J3-bounces!

---------- Forwarded message ----------
From: Rafik Zurob <rzurob at ca.ibm.com>
To: General J3 interest list <j3 at mailman.j3-fortran.org>
Cc: J3 <j3-bounces at mailman.j3-fortran.org>, Bill Long <longb at cray.com>
Date: Tue, 15 May 2018 12:46:53 -0400
Subject: Re: [J3] Vector subscripts and INTENT(INOUT)
> 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.   The same rule is in all the standards
> going back to F90.   For some reason it was dropped in the F2018
> draft, which is the one I was originally reading.  If it was added
> back into F2018, then there would be a rule-based justification for
> the claim that the dummy argument is not definable. I would find
> that a substantial improvement.

IBM XL Fortran is consistent with the above rule:

$ xlf vectorsubscript.f90 -qsource
          6 |  call sub (dat(iv))
a - "vectorsubscript.f90", line 6.13: 1516-056 (S) An accessible explicit
interface has a dummy argument with the INTENT(OUT) or INTENT(INOUT)
attribute specified. Corresponding actual argument which is not definable
is not permitted in this context.
** test_vector   === End of Compilation 1 ===
1501-511  Compilation failed for file vectorsubscript.f90.

I fully support putting the rule back in F2018 draft. (Or if there is good
reason for dropping it, I would appreciate learning it.)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20180517/c46b6333/attachment.html>

More information about the J3 mailing list