J3/01-211r1 Date: 17 Jun 2001 To: J3 From: Stan Whitlock Subject: Interp request on the NULL intrinsic (Interp # 94) ---------------------------------------------------------------------- NUMBER: 94 TITLE: NULL intrinsic in initialization expressions KEYWORDS: NULL intrinsic, initialization expressions DEFECT TYPE: Erratum STATUS: Passed by J3 meeting QUESTION: Section 7.1.6.1 says that an initialization expression may contain "(6) A reference to the transformational intrinsic function NULL," with no constraints on its argument. Therefore PROGRAM EXAMPLE CALL SUB(42) CONTAINS SUBROUTINE SUB(N) CHARACTER(N),POINTER :: CP INTEGER,PARAMETER :: M = LEN(NULL(CP)) REAL,SAVE :: X(M) END SUBROUTINE END is apparently standard-conforming, but it is difficult to see how this can work in practice, particularly if SUB were called with different values for N. Should there not be some constraint on the argument of NULL in an initialization expression? ANSWER: Yes, a constraint is needed to force initialization expressions always to be constant. An edit is supplied to correct this oversight. EDITS: [94:12+] add to end of list item "where the argument is not of type character with a length that is assumed or defined by an expression that is not an initialization expression." SUBMITTED BY: Malcolm Cohen HISTORY: 01-211 m157 Submitted 01-211r1 m157 Passed by J3 meeting