J3/98-151 Date: 1998/05/08 To: J3 From: Henry Zongaro Subject: Interpretation request for NULL as a keyword NUMBER: TITLE: Use of NULL() as initialization KEYWORDS: NULL intrinsic, initialization, default initialization, DATA statement DEFECT TYPE: STATUS: J3 consideration in progress QUESTION: Rules R429, R505 and R540 respectively describe the syntax for default initialization of pointer components, pointer objects in type declaration statements and pointer objects in DATA statements. These rules seem to indicate that NULL is to be considered a keyword in those contexts. This has the surprising effect that the first example below is a standard conforming program, while the second is not. That is, in some contexts, something that looks very much like a reference to an intrinsic function, is in fact a keyword followed by parentheses. Example 1: MODULE MOD INTRINSIC NULL END MODULE MOD PROGRAM PROG USE MOD, DISASSOCIATE=>NULL INTEGER, PARAMETER :: NULL = 17 INTEGER :: J = NULL INTEGER :: I INTEGER, POINTER :: P => NULL(), P2 DATA P2, I/NULL(), NULL/ TYPE DT INTEGER, POINTER :: P => NULL() END TYPE DT TYPE DT2 INTEGER, POINTER :: I INTEGER :: J END TYPE DT2 TYPE(DT2) :: S = DT2(DISSASSOCIATE(), NULL), S2 DATA S2/DT2(DISSASSOCIATE(), NULL)/ END PROGRAM PROG Example 2: MODULE MOD INTRINSIC NULL END MODULE MOD PROGRAM PROG USE MOD, DISASSOCIATE=>NULL INTEGER, POINTER :: P => DISASSOCIATE(), P2 DATA P2/DISASSOCIATE()/ TYPE DT INTEGER, POINTER :: P => DISASSOCIATE() END TYPE DT END PROGRAM PROG In some places in the scoping unit of PROG example 1, NULL() is used to specify initialization or default initialization, while in others NULL is a named constant, and DISSASSOCIATE() must be used to specify initialization. 1) Is example 1 a standard conforming program? 2) Is example 2 a standard conforming program? 3) Was it the intent of the committee that, within the contexts of R429, R505 and R540, NULL should be treated strictly as a keyword rather than as a reference to an intrinsic function? ANSWER: EDIT: SUBMITTED BY: Henry Zongaro HISTORY: 98-151 m145 Submitted