J3/01-154r1 Date: 12-Apr-2001 To: J3 From: interp/Stan Whitlock Subject: Interpretation 19 (Result of NULL intrinsic associated with CHARACTER(*) dummy argument) ---------------------------------------------------------------------- NUMBER: 000019 TITLE: Result of NULL intrinsic associated with CHARACTER(*) dummy argument KEYWORDS: NULL intrinsic, assumed character length parameter, argument association, pointer association DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: Consider the following program. PROGRAM P CALL SUB(NULL()) CONTAINS SUBROUTINE SUB(C) CHARACTER(*), POINTER :: C PRINT *, LEN(C) END SUBROUTINE SUB END PROGRAM P According to 7.1.4.1 [91:27-30], "The data type, type parameters and rank of the result of the intrinsic function NULL when it appears without an argument are determined by the pointer that becomes associated with the result. See Table 7.2." In this case, the pointer that becomes associated with the result is the corresponding dummy argument when the result appears as an actual argument. However, according to 5.1.1.5 [51:14-18], a dummy argument of type character, with a character length parameter of *, "assumes the length of the associated actual argument when the procedure is invoked." Is this a standard conforming program? If so, how is the length of C determined, and what should be the output of this program? ANSWER: No, this program does not conform to the standard since the actual argument does not have a character length for the dummy argument to assume. The edit makes this clear. EDIT: Page 91, subclause 7.1.4.1, last line [91:41]. Add The optional argument shall also be present if the reference appears as an actual argument corresponding to a dummy argument with assumed character length. SUBMITTED BY: Henry Zongaro HISTORY: 98-148 m145 Submitted 01-154r1 m156 Passed unanimously by J3 meeting