[J3] Generics and internal procedures

Steidel, Jon L jon.l.steidel at intel.com
Fri Aug 10 14:56:31 EDT 2018


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 :).

-jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20180810/ae9e33d1/attachment.html>


More information about the J3 mailing list