J3/09-248 To: J3 From: Van Snyder Subject: Some IEEE elemental procedures should be impure elemental Date: 2009 June 30 References: 09-007r2 1. Introduction The flags IEEE_DIVIDE_BY_ZERO, IEEE_INEXACT, IEEE_INVALID, IEEE_OVERFLOW, and IEEE_UNDERFLOW, and the IEEE HALTING mode, can be regarded as either global variables or save variables. As such, the four subroutines to get and set them ought not to be pure. This potentially has an impact on existing software, as pure procedures can presently invoke these procedures. 2. Edits w.r.t. 09-007r2 Replace "Elemental" by "Impure elemental" at the following two places: [411:21 14.11.4p2] [411:32 14.11.5p2] Replace "Pure subroutine" by "Subroutine" at the following two places: [416:40 14.11.19p2] [417:12 14.11.20p2] [24:12 1.6.2p1]--------------------------------------------------------- Editor: Replace "Any" by "With the following exception, any" [24:13+ 1.6.2p1]-------------------------------------------------------- Editor: Insert a one-item list: o The functions IEEE_GET_FLAG and IEEE_GET_HALTING_MODE in the intrinsic module IEEE_EXCEPTION were elemental and therefore pure in Fortran 2003. They are impure elemental in Fortran 2008. The subroutines IEEE_SET_FLAG and IEEE_SET_HALTING_MODE in the intrinsic module IEEE_EXCEPTIONS were pure subroutines in Fortran 2003. They are not pure in Fortran 2008. These four procedures therefore cannot be invoked from pure procedures in a program that conforms to this part of ISO/IEC 1539.