> On Mar 8, 2018, at 10:57 AM, Anton Shterenlikht <[log in to unmask]> wrote:
>
> Bill
>
>> From: Bill Long <[log in to unmask]>
>>
>> Interface bodies are separate scoping units. This allows names of dummy arguments (for example) to not conflict with names in the surrounding host. Insert an IMPORT statement to bring iarr into the interface.
>
> This is a "module procedure interface body”.
Right. I missed that part.
>
>>
>>> On Mar 8, 2018, at 10:06 AM, Anton Shterenlikht <[log in to unmask]> wrote:
>>>
>>> module m
>>> implicit none
>>> integer, parameter :: iarr = selected_int_kind( 8 )
>>> interface
>>> integer( kind=iarr ) module function f( space )
>>
>> import iarr ! Add this statement and the compilers should accept the code.
>
> Then 1 compiler accepts the code and 2 others reject with:
>
> 1) Error: F2008: C1210 IMPORT statement at (1) is not permitted in a module procedure interface body
>
> (I cannot find this constraint in F2018 though)
The corresponding constraint in F2018:
C895 (R867) An IMPORT statement shall not appear in the scoping unit of a main-program, external- subprogram, module, or block-data.
appears to have removed the previous restriction. The places were IMPORT is allowed were expanded in F2018. I think you are seeing difference here in how much of F2018 is implemented in various compilers.
Cheers,
Bill
>
> 2) error #6119: IMPORT statement is not allowed in a separate module procedure interface.
>
>
> Anton
Bill Long [log in to unmask]
Principal Engineer, Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9143
Cray Inc./ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425
|