From maine@altair.dfrf.nasa.gov Tue Mar 10 00:59:25 1992
Received: from altair.dfrf.nasa.gov by dkuug.dk via EUnet with SMTP (5.64+/8+bit/IDA-1.2.8)
	id AA08735; Tue, 10 Mar 92 00:59:25 +0100
Received: by altair.dfrf.nasa.gov (4.1/SMI-4.1)
	id AA00533; Mon, 9 Mar 92 16:00:21 PST
Date: Mon, 9 Mar 92 16:00:21 PST
From: maine@altair.dfrf.nasa.gov (Richard Maine)
Message-Id: <9203100000.AA00533@altair.dfrf.nasa.gov>
To: SC22WG5@dkuug.dk
In-Reply-To: Lawrie Schonfelder's message of Mon, 09 Mar 92 13:29:00 GMT <9203091336.AA16864@danpost2.uni-c.dk>
Subject: (SC22WG5.40)  is1539_1 a
X-Charset: ASCII
X-Char-Esc: 29

On Mon, 09 Mar 92 13:29:00 GMT, Lawrie Schonfelder <JLS@liverpool.ac.uk> said:
      ... [lots omitted] ...

> SUBROUTINE s_ass_s(var,expr)
>  type(VARYING_STRING),INTENT(OUT) :: var
>  type(VARYING_STRING),INTENT(IN)  :: expr
>  !  assign a string value to a string variable overriding default assignement
>  !  reallocates string variable to size of string value and copies characters
>  IF(ASSOCIATED(var%chars))DEALLOCATE(var%chars)
>  ALLOCATE(var%chars(1:LEN(expr)))
>  var%chars = expr%chars
> ENDSUBROUTINE s_ass_s

Isn't the above use of ASSOCIATED illegal?  The definition of ASSOCIATED
(section 13.13.13) says that the pointer association status of its argument
must not be undefined.  Section 14.6.2.1 says that the pointer association
status of a pointer is initially undefined.  I can't at the moment find
specific words that would explicitly apply to a pointer component of an
intent(out) argument, but I would expect the pointer association status
of var%chars in the above sample to be undefined.  I certainly don't see
how it could be otherwise.

The above code seems to assume that the initial the pointer association
status of var%chars will be dissassociated initially.  Furthermore,
even if the pointer association status of the actual argument were
defined when this routine was called, I think that the intent(out)
should probably make the pointer association status in the formal
argument undefined because it might not necessarily be copied from
the actual argument.

The same issue comes up at least one other place in the sample code
Lawrie provided.

--
Richard Maine
maine@altair.dfrf.nasa.gov

