To: J3 J3/21-202 From: Malcolm Cohen Subject: Interp F18/034 Purity of IEEE_GET_FLAG and IEEE_GET_HALTING_MODE Date: 2021-October-25 ---------------------------------------------------------------------- NUMBER: F18/034 TITLE: Purity of IEEE_GET_FLAG and IEEE_GET_HALTING_MODE KEYWORDS: IEEE_GET_FLAG, IEEE_GET_HALTING_MODE, PURE DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: 17.11.1 General (in 17.11 Specifications of the procedures) states "all the subroutines are impure unless otherwise stated". Table 17.3 in 17.10 Summary of the procedures classes these as "ES", where "ES indicates that the procedure is an elemental subroutine". Since Fortran 2008, being elemental has no bearing on whether a procedure is pure or impure. If it is declared with the ELEMENTAL keyword it is pure by default, that is, if the IMPURE keyword does not appear; this however only applies to elemental procedures defined by subprograms, not ones defined by standard intrinsic modules. Looking at 17.11.5 and 17.11.6, the standard merely has "Class: Elemental subroutine" which again, does not indicate purity or impurity. The lack of a statement to the contrary means that the specification in 17.11.1 is operative, and therefore IEEE_GET_FLAG and IEEE_GET_HALTING_MODE must be impure. However, these were considered to be pure in Fortran 2003, as Fortran 2003 had no concept of an impure elemental procedure - it only had pure elemental procedures. Further evidence that the current situation might be a mistake is that the non-elemental subroutines IEEE_SET_FLAG and IEEE_SET_HALTING_MODE are explicitly specified to be pure. Are IEEE_GET_FLAG and IEEE_GET_HALTING_MODE intended to be pure? ANSWER: Yes, these subroutines were intended to be pure. Edits are provided to correct this mistake. EDITS to 18-007r1: [440:8] 17.10 Summary of the procedures, p3, line "ES indicates...", "an elemental subroutine" -> "a pure elemental subroutine". [443:23] 17.11.5 IEEE_GET_FLAG (FLAG, FLAG_VALUE), para 2 Class, "Elemental" -> "Pure elemental". [443:34] 17.11.6 IEEE_GET_HALTING_MODE (FLAG, HALTING), para 2 Class, "Elemental" -> "Pure elemental". SUBMITTED BY: Malcolm Cohen HISTORY: 21-nnn m225 F18/034 submitted ----------------------------------------------------------------------