J3/15-209 To: J3 From: Malcolm Cohen Subject: Prohibit useless extension? Date: 2015 August 06 1. Introduction Discussion of a recent interpretation request raised the issue that a module that is complete in itself, that is, declares no separate module procedures, cannot usefully be extended. This is true of all pre-F2008 modules. Allowing extension of such a module via a submodule provides no functionality to the user, but requires that the processor keep internal (PRIVATE) details of the module around to satisfy the requirements on error detection. The private details would be needed to compile the useless submodule as it might have used a private type, parameter, or variable. Also, they would be needed to diagnose mal-use of the private entity when such usage is covered by a constraint. Prohibiting such extension would alleviate the burden on implementors. If we insert this prohibition via the interp process, it would not be an incompatibility (since submodules were only introduced in F2008), whereas adding this prohibition as a Fortran 2015 work item would introduce an incompatibility with Fortran 2008. 2. Draft interpretation ---------------------------------------------------------------------- NUMBER: F08/0142 TITLE: Is useless module extension permitted? KEYWORDS: SUBMODULE DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: If a module declares no separate module procedure, it cannot have a useful submodule as such a submodule has nothing to provide. Its module procedures and variables cannot be referenced by any program. Should useless extension have been prohibited? ANSWER: Yes. Permitting such extension would require the implementation to export the private details of a module merely for the purpose of compiling a useless submodule. An edit is provided to require the ancestor of a submodule to have declared a separate module procedure. EDITS: [275:18] 11.2.3 Submodules, C1113, After "shall be the name of a nonintrinsic module" insert "that declares a separate module procedure". SUBMITTED BY: Daniel Chen HISTORY: 15-nnn m207 F08/0142 Submitted ----------------------------------------------------------------------