12-104 To: J3 Subject: Interpretation concerning pure procedures in intrinsic modules From: Van Snyder Date: 2012 January 19 Several procedures in IEEE_Arithmetic are specified to be pure, but the definition of purity in 12.7p1 does not admit the possibility that procedures that are neither intrinsic nor defined by pure subprograms can be pure. Several procedures in ISO_Fortran_Env and ISO_C_Binding are not specified to be pure, but there appears not to be any reason for them to be impure. ---------------------------------------------------------------------- NUMBER: F08/xxxx TITLE: Should certain procedures in intrinsic modules be pure? KEYWORDS: pure, intrinsic, intrinsic module DEFECT TYPE: Erratum STATUS: Under J3 consideration QUESTION: 1. 12.7 doesn't allow a procedure in an intrinsic module to be pure unless it's actually defined by a pure subprogram (as opposed to being provided by the processor). Nonetheless, some of the procedures in IEEE_Arithmetic are specified to be pure. How can they be pure? 2. The COMPILER_OPTIONS and COMPILER_VERSION functions in the intrinsic module ISO_Fortran_env are not described as being pure, but there is no apparent reason for any of them to be impure. Were they intended to be pure? The original proposal for compile-time information, in 05-123r2, was silent concerning this issue, but the revision in 06-136r1 proposed that they be usable for initialization, which requires purity. 3. The procedures in ISO_C_Binding are not specified to be pure, but there is no apparent reason for any of them to be impure. Were they intended to be pure? ANSWER: 1. The list in subclause 12.7, paragraph 1, is incomplete. An edit is supplied to correct it. 2. The procedures were intended to be pure. An edit is supplied to correct this oversight. 3. The procedures were intended to be pure. An edit is supplied to correct this oversight. EDITS: 1: [12.7p1 312:12+] Insert a list item " o a module procedure in an intrinsic module, if it is specified to be pure," (or maybe "unless it is specified to be impure?") 2: [13.8.2p2 397:7] Append a sentence to the paragraph: "The procedures in the module are pure." 3: [15.2.3.1p1 426:15] Append a sentence to the paragraph: "The procedures in the module are pure." SUBMITTED BY: Van Snyder HISTORY: 12-xxx m197 F08/xxxx submitted