(j3.2006) implicit none (external)
Tue Jun 6 21:28:24 EDT 2017
I disagree thoroughly with your draft paper. There is NO DOUBT WHATSOEVER
that an interface body explicitly specifies the EXTERNAL attribute, how much
more explicit can we be? Ditto the PROCEDURE statement, when it says
"specifies the EXTERNAL attribute", that is most certainly explicit.
You will recall that "implicit specifications" can always be confirmed by an
explicit specification, and that is absolutely Not Permitted in this case.
This is Fortran 90 stuff!!!
Finally, every time something implicitly has the XYZ attribute, we actually
say "implicitly has the XYZ attribute". A piece of concrete, i.e. explicit,
syntax that *specifies the XYZ attribute* is an EXPLICIT specification.
This is the plain ordinary English meaning of "explicit" here!
My 3rd argument is the only valid one for a change in wording. I do not
understand what is confusing about it, so here is an example:
! An external subprogram (not internal or module):
RECURSIVE SUBROUTINE sub()
The above subprogram defines two external procedures, SUB and ESUB. So,
within the subprogram, SUB and ESUB are the names of external procedures.
However, SUB and ESUB do NOT have the EXTERNAL attribute within the
subprogram, and the user is FORBIDDEN to give them the EXTERNAL attribute
(C840). So SUB and ESUB violate C893, because each one is "the name of an
external or dummy procedure in that scoping unit" and cannot "be explicitly
declared to have the EXTERNAL attribute".
There are other places where we have special requirements or effects for use
of an external procedure name when it is a procedure defined by the
subprogram where the use occurs, and we sometimes use wording like
" that scoping unit is of a subprogram that defines a procedure with
..............Malcolm Cohen, NAG Oxford/Tokyo.
From: j3-bounces at mailman.j3-fortran.org
[mailto:j3-bounces at mailman.j3-fortran.org] On Behalf Of John Reid
Sent: Monday, June 5, 2017 6:34 PM
To: fortran standards email list for J3 <j3 at mailman.j3-fortran.org>
Subject: Re: (j3.2006) implicit none (external)
I have drafted a paper on this. It does not mention your third argument
because I do not understand it well enough to explain it. You are welcome to
add to this and join me as a co-author, or we can leave this for Garching.
Having the paper at least prevents our forgetting about it.
Malcolm Cohen wrote:
> John Reid writes:
> C893 says "If IMPLICIT NONE with an implicit-none-spec of EXTERNAL
> appears within a scoping unit, the name of an external or dummy
> procedure in that scoping unit or in a contained subprogram or BLOCK
> construct shall be explicitly declared to have the EXTERNAL attribute."
> I think we need the edit
> [120:25] After "procedure" add "with an implicit interface".
> or am I missing something?
> There are only two ways that an external or dummy procedure can have
> an explicit interface.
> (1) It is declared with an interface body; see 305:25
> "An interface body in a generic or specific interface block
> the EXTERNAL attribute"
> so that is an explicit declaration that the procedure has the EXTERNAL
> (2) It is declared with a procedure declaration; see 310:28-29
> "A procedure declaration statement ... specifies the EXTERNAL
> so again, that is an explicit declaration that the procedure has the
> EXTERNAL attribute.
> So far, we would appear to be fine. However there is actually a third
> way a procedure can have an explicit interface:
> (3) It is a procedure being defined by the current subprogram (under
> certain conditions), and the current subprogram is an external
> subprogram. It is forbidden to give such a procedure the EXTERNAL
> attribute (so goodbye functions returning procedure pointers?).
> Looking at some of the relevant text hereabouts I can see some partial
> duplication (a restriction is stated in two places, incompatibly!).
> So there might be other problems. But (3) does look on the face of it
> to be a problem. John's fix would work, but is unlike similar text
> better fixes (following wording elsewhere) would be either
> (a) say something like "other than a procedure being defined by the
> subprogram"; this has the advantage of actually saying what it is we
> want to say, but it is going to be more wordy.
> Or (b) say "shall have an explicit interface or be explicit declared
> to have the EXTERNAL attribute".
> The (b) wording is certainly simple enough, and easy to get right, so
> perhaps that should be in any meeting paper about it. However, I do
> have a slight preference for the (a) solution, that is, if we can get
> the wording clear enough without excessive verbiage. I have not tried
> to do this (right now I am somewhat overloaded) but it's probably
> worth thinking about at the meeting (or between now and then).
This e-mail has been scanned for all viruses by Star.
More information about the J3