09-137 To: J3 From: Malcolm Cohen Subject: Applying F03 corrigendum 3 to 09-007. Date: 2009 February 09 1. Introduction --------------- This document lists the interps in F2003 Corrigendum 3 together with their required action in F2008. 2. The Interps -------------- F03/0050: Erratum - edits relevant to F2008. F03/0079: Erratum - edits relevant to F2008. F03/0080: Interpretation - no edit required. F03/0086: Erratum - edits relevant to F2008. F03/0088: Erratum - edits have already been applied to F2008, though the first edit [262:12] has been applied to p2 instead of p1; after reviewing the results, I believe the F2008 location is better. F03/0089: Erratum - edits relevant to F2008. F03/0092: Erratum - edits relevant to F2008. F03/0093: Erratum - edits relevant to F2008. F03/0094: Erratum - edits relevant to F2008. F03/0095: Interpretation - no edit required. F03/0097: Erratum - edits relevant to F2008. F03/0101: Erratum - edits relevant to F2008. F03/0104: Interpretation - no edit required. F03/0106: Erratum - edits relevant to F2008. F03/0107: Erratum - edits relevant to F2008. F03/0108: Clarification - no edit required. 3. Edits to 09-007 ------------------ [58:14] In the last sentence of C480 in 4.5.5 "Final subroutines", replace "not have INTENT(OUT)" with "not have the INTENT(OUT) or VALUE attribute". {F03/0094.} [156:19(7.2.1.3p3)] Insert new sentence at beginning of paragraph "If is an unallocated allocatable array, shall have the same rank as ." {F03/0093.} [156:21-24(7.2.1.3p3)] Replace last sentence of paragraph "If the variable is or becomes an unallocated allocatable variable, then it is allocated with each deferred type parameter equal to the corresponding type parameter of , with the shape of , with each lower bound equal to the corresponding element of LBOUND(), and if the variable is polymorphic, with the same dynamic type as ." to "If the variable is or becomes an unallocated allocatable variable, it is then allocated with - if the variable is polymorphic, the same dynamic type as , - each deferred type parameter equal to the corresponding type parameter of , - if the variable is an array and is scalar, the same bounds as before, and - if is an array, the shape of with each lower bound equal to the corresponding element of LBOUND()." ALTERNATIVE: "If the variable is or becomes an unallocated allocatable variable, it is then allocated with each deferred type parameter equal to the corresponding type parameter of . If the variable is an array and is scalar, the allocation is with the same bounds as before. If is an array the allocation is with the shape of and with each lower bound equal to the corresponding element of LBOUND(). If the variable is polymorphic the allocation is with the same dynamic type as ." {F03/0093. Note that this paragraph needed extensive grammatical work, thus the large edit. The list seems easier to read than ordinary prose, but both are unambiguous (and, I hope, correct) after splitting the various facets of the allocation. [162:18(7.2.2.4p6)] After "the same type" insert " or both be unlimited polymorphic". {F03/0092.} PREFERRED ALTERNATIVE: [162:18-19(7.2.2.4p6) "If ... shall have" "If is a function with an implicit interface, shall be a function with" {Paragraph 3 already requires ALL the characteristics be the same for the "pointer has an explicit interface" case, so we only need to specify the situation for the "pointer has an implicit interface" case. That case ***does not allow CLASS(*) anyway***. Thus removing the unwanted redundancy fixes the problem identified by the interp.} NOTE: We could swap some wording in p5 and p6 to make this even smoother? [223:30+(9.6.4.3p6+)] Between p6 and Note 9.49 insert new paragraphs: "During the execution of an output statement that specifies an internal file, no part of that internal file shall be referenced, defined, or become undefined as the result of evaluating any output list item. During the execution of an input statement that specifies an internal file, no part of that internal file shall be defined or become undefined as the result of transferring a value to any input list item." {F03/0050.} [238:21(9.10.2.9 DIRECT=)] At the end of the last sentence, insert "or if the unit identified by is not connected to a file". {F03/0106. In this and other edits, "specified by UNIT=" in the interp has become "identified by ", because the former is incorrect when the optional UNIT= syntax is omitted.} [238:27(9.10.2.10 ENCODING=)] After "unable to determine the encoding form of the file" insert "or if the unit identified by is not connected to a file". {F03/0106.} [239:5(9.10.2.13 FORMATTED=)] At the end of the last sentence, insert "or if the unit identified by is not connected to a file". {F03/0106.} Changes to NEXTREC= unnecessary because it already handles the condition. [239:24-25 (9.10.2.18 NUMBER=)] Replace paragraph with "Execution of an INQUIRE by file statement causes the in the NUMBER= specifier to be assigned the value of the external unit number of the unit that is connected to the file. If there is no unit connected to the file, the value -1 is assigned. Execution of an INQUIRE by unit statement causes the to be assigned the value of ." {F03/0106.} [240:19(9.10.2.22)] Before "the file is not connected" insert "there is no connection,", After "for stream access" insert comma. {F03/0106, reworded; for connection properties "no connection" is clearly better wording.} [240:34(9.10.2.24 READ=)] Add to the end of the last sentence "or if the unit identified by is not connected to a file". {F03/0106.} [241:5(9.10.2.25 READWRITE=)] Add to the end of the last sentence "or if the unit identified by is not connected to a file". {F03/0106.} [241:23(9.10.2.28 SEQUENTIAL=)] Add to the end of the last sentence "or if the unit identified by is not connected to a file". {F03/0106.} [241:31(9.10.2.30 SIZE=)] After "determined" insert "or if the unit identified by is not connected to a file". {F03/0106.} [241:40(9.10.2.31 STREAM=)] Add to the end of the last sentence "or if the unit identified by is not connected to a file". {F03/0106.} [242:5(9.10.2.32 UNFORMATTED=)] Add to the end of the last sentence "or if the unit identified by is not connected to a file". {F03/0106.} [242:10(9.10.2.33 WRITE=)] Add to the end of the last sentence "or if the unit identified by is not connected to a file". {F03/0106.} [253:24+ (10.7.2.1, at the end)] Insert new list item "(7) On output of a real zero value, the digits in the exponent field shall all be zero." {F03/0079.} [267:5(10.10.4)] Append to paragraph "The form of the values produced by defined output (9.6.4.7) is determined by the defined output procedure; this form need not be compatible with list-directed input." {F03/0101, reworded. 9.6.4.7 is \ref{D9:User-defined derived-type input/output}. Hyperlink "defined output" to "defined input/output".} [268:25(10.11.2p3)] Replace whole paragraph with "A value separator for namelist formatting is a value separator for list-directed formatting (10.10), or one or more contiguous blanks between a nonblank value and the following object designator or "!" comment initiator." {F03/0097.} [272:3,6(10.11.4.1p1)] After "output produced" insert "by intrinsic namelist output", Append to paragraph "The form of the output produced by defined output (9.6.4.7) is determined by defined output procedure; this form need not be compatible with namelist input." {F03/0101, reworded. 9.6.4.7 is \ref{D9:User-defined derived-type input/output}. Hyperlink "defined output" to "defined input/output".} [310:10-11(12.6.2.1 C1245)] Replace constraint with "C1245 An elemental procedure shall not have the BIND attribute.". {F03/0086.} [413:26-27(14.10.3p1)] After "elemental functions for" insert "all", Delete "for which ... are true". {F03/0107.} [Nowhere] The interp requests insertion of an excessively large note in F2008 explaining the answer with a suggested implementation technique. The latter is certainly completely unnecessary. I believe the former also to be unnecessary, and the particular note suggested is in any case unsatisfactory since it displays quite a silly example (not to mention the language used does not conform to ISO guidelines). Here is the suggested note: "The standard requires that code such as if (IEEE_SUPPORT_DATATYPE(x)) then x = IEEE_SCALB(x,2) else x = x*4 endif be executable. The elemental functions in the IEEE_ARITHMETIC module (14.9.2) must exist for all real kinds supported by the processor, even if IEEE_SUPPORT_DATATYPE returns false for some kinds. However, if IEEE_SUPPORT_DATATYPE returns false for a particular kind, these functions must not be invoked with arguments of that kind. This allows a careful programmer to write programs that work on processors that do not support IEEE arithmetic for all real kinds. The processor might provide stub routines which allow the program to link and execute, but which will abort if they are invoked." We don't provide notes about other IEEE module procedures which we also require to exist but forbid invocation, e.g. IEEE_GET_ROUNDING MODE. If we REALLY REALLY must have some kind of note here, something much shorter like "NOTE Although some of the procedures provided by these modules are not permitted to be invoked with particular kinds of arguments, the functions shall nonetheless exist for those forbidden argument kinds." would be closer to acceptable. (Still not right, but getting closer.) My recommendation is to forget this - the standard is already clear. {F03/0107.} [439:13-14(15.3.4p2)] After "with a C struct type" change "if" to "if and only if", Delete "the derived-type definition of", Change "specified BIND(C)" to "has the BIND attribute". {F03/0089. After the interp edit the requirement is (I believe) broken: prior to that edit we allowed an intrinsic module to provide derived types that would interoperate with C struct types, but the interp answer makes no mention of any deliberate disallowance of this possibility. (A derived type in an intrinsic module does not have a derived-type definition, but might nonetheless have the BIND attribute.) Anyway, we use "BIND attribute" in all the constraints immediately preceding, so why use different language here?} ===END===