J3/99-207 Date: 09 August 1999 To: J3 From: Keith Bierman Subject: Interpretation request on LEN of null NUMBER: TITLE: LEN of null KEYWORDS: DEFECT TYPE: STATUS: submitted QUESTION: Consider the program INTEGER FUNCTION F(I) INTEGER I F = I END PROGRAM MAIN INTEGER F EXTERNAL F CHARACTER*26 STRING DATA STRING/'ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ PRINT *, LEN( (/ (STRING(1:F(I)), I = 1,0) /) ) END Is this Standard Conformant? If so, what is the defined result? ANSWER: Don't know. One can imagine that the answer was intended to be "no" and that the standard is lacking words. In the alternative, the answer was intended to be "yes" and the Standard is missing words that assert that the result is totally processor dependent (including if it's an error). Discussion: To casual reader, this program appears standard conformant. However, it would seem to the same casual reader, that the result of running of this program ought to be undefined (or professor defined, perhaps), but finding anything in the standard to this effect seems difficult. FWIW: Sun f90 2.0 allocates a temporary for the length on the stack. After not executing the array constructor, it prints the value of the temporary. EDITS: SUBMITTED BY: Robert Corbett HISTORY: