(j3.2006) IMPORT, C894
Malcolm Cohen
malcolm
Wed May 3 21:03:36 EDT 2017
Erik Kruyt writes:
<<<
I am puzzled about C894. Is the following code not standard conforming?
module mod
integer i
interface
subroutine sub
import
end subroutine sub
end interface
end module mod
>>>
It is certainly intended to be.
<<<
According to R504, R507, R508 the interface belongs to the
specification-part of the module.
In Fortran 2008 this constraint was not present.
>>>
In Fortran 2008 this constraint was worded differently:
C1210 (R1209) The IMPORT statement is allowed only in an interface-body that
is not a module procedure interface body.
<<<
Why is this introduced?
>>>
Because F2015 has extended the IMPORT statement, and now allows it to appear
in many places forbidden by F2008.
Reviewing C894:
"C894 (R867) An IMPORT statement shall not appear in the specification-part
of a main-program, external subprogram, module, or block-data."
Perhaps this should be changed to say "scoping unit" instead of
"specification-part". Or an exception added ", except that it may appear in
an interface-body".
Cheers,
--
.............................Malcolm.
More information about the J3
mailing list