From jkr@jkr.cc.rl.ac.uk  Tue Feb 20 12:35:59 2001
Received: from nameserv.rl.ac.uk (nameserv.rl.ac.uk [130.246.135.129])
	by dkuug.dk (8.9.2/8.9.2) with ESMTP id MAA70413
	for <SC22WG5@dkuug.dk>; Tue, 20 Feb 2001 12:35:59 +0100 (CET)
	(envelope-from jkr@jkr.cc.rl.ac.uk)
Received: from jkr.cc.rl.ac.uk (jkr.cc.rl.ac.uk [130.246.8.20])
	by nameserv.rl.ac.uk (8.8.8/8.8.8) with ESMTP id LAA29255
	for <SC22WG5@dkuug.dk>; Tue, 20 Feb 2001 11:35:58 GMT
Received: (from jkr@localhost)
	by jkr.cc.rl.ac.uk (8.8.8+Sun/8.8.8) id LAA21219
	for SC22WG5@dkuug.dk; Tue, 20 Feb 2001 11:37:46 GMT
Date: Tue, 20 Feb 2001 11:37:46 GMT
From: John Reid <jkr@rl.ac.uk>
Message-Id: <200102201137.LAA21219@jkr.cc.rl.ac.uk>
To: SC22WG5@dkuug.dk
Subject: Iterpretation 19 (NULL intrinsic): Draft response
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"


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 parogram 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
