(j3.2006) implicit none (external)
Malcolm Cohen
malcolm
Sun Jun 4 21:45:47 EDT 2017
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,
--
.............................Malcolm.
More information about the J3
mailing list