J3/06-107 Date: December 5, 2005 To: J3 From: Aleksandar Donev Subject: C interop NUMBER: F03/0076 TITLE: Scope of Fortran names of procedures with binding labels KEYWORDS: Interoperability, dummy procedures DEFECT TYPE: CLARIFICATION/ERRATUM STATUS: J3 consideration in progress QUESTION: Is the following conforming: module A interface subroutine CProc() bind(C,name="AnExternalCProcedure") end subroutine end interface end module module B interface subroutine CSub() bind(C,name="AnExternalCProcedure") end subroutine end interface end module ANSWER: The standard's current wording is such that his is not conforming. The name of an external procedure is a global entity and it is unique to a given procedure. That is, the external C procedure AnExternalCProcedure, must be given a unique Fortran name inside a Fortran program. However, the question is whether this was intended or whether it happened by virtue of improper integration of binding labels (which should be global entities, rather than the Fortran name) with the existing words for Fortran external procedures (which have only one name, the Fortran name, and therefore it should be global). Forbidding examples like tone one above violate basic principles of modularity and introduce global entities without justification. The Fortran names given to the external C procedure AnExternalCProcedure should be local to the scopes of modules A and B respectively, not of global scope. Correcting this problem may be done in the next revision of the standard, if it is deemed that the answer to this Interp ought to be yes. EDITS: SUBMITTED BY: Aleksandar Donev HISTORY: J3/06-107 at meeting 175