J3/02-326r1 Date: Nov 13, 2002 To: J3 From: Michael Ingrassia Subject: Bug in the Procedure Pointers feature? Incorrect statement that may need fixing (i.e. possible "bug" in the standard). ------------------------------------------------------------- 2.2.3.2 line 27 says "A module procedure may be invoked by another module subprogram in the module or by any scoping unit that accesses the module procedure by use association" This leaves out the case where module procedure P is invoked via a procedure pointer from a location where the module procedure is not accessed by use association, e.g. MODULE M CONTAINS FUNCTION P() P = 1776. END FUNCTION P END MODULE INTERFACE SUBROUTINE S(Q) PROCEDURE (REAL), POINTER :: Q END SUBROUTINE S END INTERFACE USE M PROCEDURE (REAL), POINTER :: C C => P CALL S(C) END PROGRAM SUBROUTINE S(Q) PROCEDURE (REAL), POINTER :: Q ! invoke module procedure P which is not use-associated with Q PRINT *, Q() END SUBROUTINE S --------------------------------------------------------------- The example is permitted, see 12.3.2.3 [02-007R3 page 260]. The line quoted is misleading, because it is incomplete, but it is not actually untrue.