[J3] Generics and internal procedures

Bill Long longb at cray.com
Fri Aug 10 19:05:22 EDT 2018


F2008 newly allowed internal procedures to be associated with procedure pointers.  So disallowing an internal procedure in a context were a procedure pointer associated with that internal procedure is allowed would seem like an empty limitation. 

Cheers,
Bill



> On Aug 10, 2018, at 1:56 PM, Steidel, Jon L via J3 <j3 at mailman.j3-fortran.org> wrote:
> 
> In F2003, clause 12.3.2.1 Interface block, we had constraint C1207 pertaining to a procedure statement in a generic interface block:
>  
>    “A procedure-name shall have an explicit interface and shall refer to an accessible procedure pointer,
>      external procedure, dummy procedure, or module procedure.”
>  
> This constraint disappeared in F2008, but in a reorganized clause 12, section 12.4.3.4.1 Generic identifiers the following normative text appears in paragraph 1:
>    
>    “A generic interface block specifies a generic interface for each of the procedures in the interface block. The PROCEDURE statement lists
>      procedure pointers, external procedures, dummy procedures, or module procedures that have this generic interface. …”
>  
> F2018 has no constraint, but has the same normative text as F2008.
>  
> The constraint and the normative text both prohibit internal procedures in a generic interface.  All three standards have a constraint on the procedure statement
> in a generic interface block stating
>  
>    “A procedure-name shall be a nonintrinsic procedure that has an explicit interface.”
>  
> An internal procedure has an explicit interface.
>  
> So I have two questions.  1) Why do we disallow internal procedures in a generic interface? 2) Why was the constraint requiring diagnosis of an internal procedure in a generic interface removed?
>  
> Some compilers I’ve tried allow an internal procedure in a generic interface, and produce the expected results, while others continue to diagnose this as an error.
>  
> I find it odd that we’d actually remove a constraint unless we intended to allow something which was previously prohibited J.
>  
> -jon

Bill Long                                                                       longb at cray.com
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




More information about the J3 mailing list