J3/04-319r1 To: J3 From: Malcolm Cohen Subject: Enhanced STOP Date: 2004/08/08 References: 04-102, 04-265r1, 04-319 The spreadsheet 265r1 lists "Enhanced STOP" as a "trivial" item. This paper suggests detailed specifications and edits against 04-007. Number: Title: Enhanced STOP Submitted By: J3 Status: For Consideration References: 04-007 8.4 STOP Statement page 170 Basic Functionality: Trivially enhance the STOP statement for modern processors Rationale: The current STOP statement is vaguely defined, and has not been updated in accordance with modern practice. Furthermore, it's syntax is peculiarly limited, going back to Fortran 66 days. Estimated Impact: At 167, J3/JoR estimated the impact as "Trivial". This is recorded in 04-265r1. Detailed Specification: Modern practice suggests that (a) the stop code should be written to the standard error unit (b) an integer stop code should be returned as the process exit status. There are four peculiarities of STOP syntax: (1) An integer stop code is limited to 5 digits. (2) An integer stop code must be a literal constant, it cannot be a named constant. (3) A stop code must be a literal or named constant, it cannot be a constant (i.e. initialization) expression. (4) A stop code must be constant, it cannot be a non-constant expression. This paper advocates lifting all of these restrictions. Lifting all of them probably has less impact (or at least no more impact) than releasing some of them, as the processor can then simply use its normal expression evaluation mechanism. Edits to 04-007: [170:22-24] Replace with "R850 stop-code is scalar-char-expr or scalar-int-expr C834 (R850) scalar-char-expr shall be of default kind. C834a (R850) scalar-int-expr shall be of default kind." [170:26-27] Delete "Leading ... significant." and insert "This should be by formatted output on the unit identified by the named constant ERROR_UNIT from the ISO_FORTRAN_ENV intrinsic module. If the stop code is of type integer, its value should be used as the process exit status if the processor has such a concept." [170:29+] Add note "Note 8.21a Even if it has the concept of process exit status, a processor might only interpret values within a limited range, or only a limited portion (e.g. the least significant 8 bits) of an integer stop code." {Note to J3: These edits are still not good enough.} History: Submitted by paper 04-102 at meeting 167. Details submitted by paper 04-319 at meeting 169. Suggested revision by paper 04-319r1 at meeting 169.