From j.l.schonfelder@liverpool.ac.uk  Thu Mar 30 14:31:44 2000
Received: from mailhub1.liv.ac.uk (mailhub1.liv.ac.uk [138.253.100.94])
	by dkuug.dk (8.9.2/8.9.2) with ESMTP id OAA25927
	for <SC22WG5@dkuug.dk>; Thu, 30 Mar 2000 14:31:41 +0200 (CEST)
	(envelope-from j.l.schonfelder@liverpool.ac.uk)
Received: from pcmail2.liv.ac.uk ([138.253.252.15])
	by mailhub1.liv.ac.uk with esmtp (Exim 2.12 #1)
	id 12ae6r-0006Te-00
	for SC22WG5@dkuug.dk; Thu, 30 Mar 2000 12:31:37 +0000
Received: from [138.253.102.118] (helo=pc102118.liv.ac.uk)
	by pcmail2.liv.ac.uk with smtp (Exim 2.12 #1)
	id 12ae6p-0005S3-00
	for SC22WG5@dkuug.dk; Thu, 30 Mar 2000 13:31:36 +0100
From: Lawrie Schonfelder <j.l.schonfelder@liverpool.ac.uk>
Reply-To: j.l.schonfelder@liverpool.ac.uk
To: SC22/WG5 members <SC22WG5@dkuug.dk>
Subject: Semantics of the SIZE intrinsic
Message-ID: <SIMEON.10003301335.E@pc102118.liverpool.ac.uk>
Date: Thu, 30 Mar 2000 13:31:35 +0100 (GMT Daylight Time)
Priority: NORMAL
X-Mailer: Simeon for Win32 Version 4.1.5 Build (43)
X-Authentication: IMSP
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII

I have just run into a difficulty with the SIZE intrinsic.
As currently defined it is illegal to call it with a disassociated pointer to 
an array. However, there is no way that I know of to initialise such a 
pointer to anything other the NULL(). This means that safe procedures cannot 
be easily written that depend on local working variables whose size is a 
function of such a pointer argument. This is a common requirement. Many 
compilers very sensibly extend the definition to allow disassociated pointers 
to arrays and deallocated allocatable arrays as arguments and return the 
obvious zero result. One at least appears in checking mode to abort the 
program and in non-checking mode to return some arbitrary value.

Could we not have a minor extension to the standard and define the SIZE 
intrinsic to return zero in such cases.

The alternative would be to provide some way of allowing a pointer to be 
initialised to have a zero sized array target and likewise an allocatable 
array to a zero sized array instead of deallocated. In fact I would like both 
but I would settle for the extended SIZE definition.

--
Lawrie Schonfelder
Director, Computing Services Dept.
The University of Liverpool, UK, L69 7ZF
Phone: 44(151)794 3716, Fax: 44(151)794 3759




