08-289 To: J3 From: Robert Corbett (with Michael Ingrassia) Subject: Five missing incompatibilities Date: 2008 November 03 Section 1.5 of CD 1539-1 does not list some incompatibilities. Because the response to Public Review Comment J32019 assures me that the list of incompatibilities is intended to be exhaustive, I am letting the committee know the missing incompatibilities I know about. I doubt that my list includes all of the missing incompatibilities. 1. the intrinsic function FRACTION [348:13.7.63p5] In Fortran 2003, the result of applying FRACTION to an IEEE infinity is that IEEE infinity. In CD 1539-1, the result of applying FRACTION to an IEEE infinity is a NaN. 2. the attribute EXTERNAL FORTRAN 77, Fortran 90, and Fortran 95 allowed an external procedure to be declared to have the EXTERNAL attribute within the scoping unit of its procedure definition. FORTRAN 77 and Fortran 90 effectively required a procedure to be explicitly declared to have the EXTERNAL attribute if it was to be passed as a procedure actual argument in its own scoping unit. Fortran 2003 prohibits declaring a procedure from being named in an EXTERNAL statement within the scoping unit of its procedure definition (246:12.3.2.2l2,3 of the Fortran 2003 standard). The CD 1539-1 specification additionally banned an external procedure from being declared to have the EXTERNAL attribute in a type declaration statement (94:5.3.9p2 of CD 1539-1). 3. the attribute INTRINSIC Fortran 90 and Fortran 95 allowed the name of a generic intrinsic interface to be declared to have the INTRINSIC attribute in the same scoping unit where that name is the name of an explicit generic interface that contains specific interfaces that conflict with the intrinsic interface. The committee ruled in an interpretation that in such cases, the user specified interfaces took precedence over the intrinsic. Constraint C547 of the Fortran 2003 standard and Constraint C542 of CD 1539-1 prohibit the name from being declared to have the INTRINSIC attribute in the presence of such an explicit generic interface. 4. printing negative zero FORTRAN 77 and Fortran 90 required the program PROGRAM MAIN PRINT '(SS, F2.0)', -0.0 END to print "0.", up to possible input/output error conditions. A recent Fortran 2003 interpretation ruled that a conforming processor could print "**" for such a program. It is unclear whether Fortran 95 imposed the same rule as Fortran 90 or Fortran 2003. 5. automatic arrays James van Buskirk pointed out on comp.lang.fortran that the definition of an automatic array was changed by Corrigendum 1 to the Fortran 95 standard, and again by the Fortran 2003 standard. Corrigendum 1 to the Fortran 95 standard changed the definition of an automatic array to be one where a bounds expression is not an initialization expression. The Fortran 2003 standard changed the definition of an initialization expression. The example James van Buskirk was in essence RECURSIVE SUBROUTINE SUBR INTEGER M(INT(1.0)) SAVE . . . END In Fortran 95, the primaries of an initialization expression must be of type integer or character. Therefore, in Fortran 95 as modified by Corrigendum 1, M is an automatic array. Since an automatic array is not allowed to have the SAVE attribute, M does not have the SAVE attribute in SUBR. In Fortran 2003, the restriction on the types of primaries in initialization expressions was removed. Therefore, M ceased to be an automatic array, and so it acquired the SAVE attribute.