J3/01-154 Date: 3 March 2001 To: J3 From: John Reid Subject: Interpretation 19 (Result of NULL intrinsic associated with CHARACTER(*) dummy argument) Here is a draft answer for interp. 19. I sent an earlier draft to the WG5 list for comments and would like thank those that helped me get to this version. .............................................................. 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: 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