J3/04-319r2 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. Discussion: 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. Detailed Specification: (1) The stop code shall be allowed to be a scalar initialization expression of type default integer or default character. (2) Recommend that the stop code be displayed on ERROR_UNIT. (3) Recommend that if the stop code is of integer type, it should be used as the process exit status (if the processor even has such a concept). (4) Note that the processor might use only a portion of such a stop code for the exit status. History: Submitted by paper 04-102 at meeting 167. Details submitted by paper 04-319 at meeting 169. Suggested revision by paper 04-319r2 at meeting 169.