(j3.2006) implicit none (external)

John Reid John.Reid
Mon Jun 5 05:34:02 EDT 2017


Malcolm,

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.

Cheers,

John.

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
> specifies the EXTERNAL attribute"
> so that is an explicit declaration that the procedure has the EXTERNAL
> attribute.
>
> (2) It is declared with a procedure declaration; see 310:28-29
> 	"A procedure declaration statement ... specifies the EXTERNAL
> attribute"
> 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 elsewhere:
> 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).
>
> Cheers,
>
-------------- next part --------------
                                                           J3/17-xxx
To: J3
From: John Reid
Subject: EXTERNAL specifier on IMPLICT NONE
Date: 2017 June 5

Discussion:
-----------
In 8.7 IMPLICIT statement, 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."

There is room for doubt about the meaning of "explicitly declared to 
have the EXTERNAL attribute". [305:25] says "An interface body in a 
generic or specific interface block specifies the EXTERNAL attribute"
and [310:28-29] says "A procedure declaration statement ... specifies 
the EXTERNAL attribute ...". I take the view that these are implicit 
declarations and that an edit to C893 is needed. 

Edit to 17-007r1:
------------------

[120:26] In 8.7 IMPLICIT statement, C893, after "construct shall" add
"have an explicit interface or". 



More information about the J3 mailing list