J3/98-164 Date: 28th May 1998 To: J3 From: Malcolm Cohen Subject: Interpretation Request on Statement Functions NUMBER: 28 TITLE: Implicitly Typed Statement Function Character Dummy KEYWORDS: statement function, constant expression, implicit typing DEFECT TYPE: Clarification STATUS: J3 consideration in progress QUESTION: Is the following program-unit standard-conforming? SUBROUTINE sub(n) IMPLICIT CHARACTER*(n) (c) stmtfn(ch) = LEN(ch) END A quick survey of 6 compilers showed no consensus on whether this was legal, with 3 accepting it (as standard-conforming), 2 rejecting it, and 1 crashing with an internal error. ANSWER: No. DISCUSSION: [51:32-33] requires explicitly-specified character lengths for statement functions and statement function dummy arguments to be constant specification expressions. This requirement should also be applied to implicitly typed entities. EDIT: [211:35+] Add new paragraph "If a statement function or statement function dummy argument is implicitly typed and is of type character, its corresponding character length specification (if any) shall be a constant specification expression." SUBMITTED BY: Malcolm Cohen HISTORY: Submitted 28th May 1998