From dnagle@erols.com  Thu Mar 30 15:13:59 2000
Received: from smtp03.mrf.mail.rcn.net (smtp03.mrf.mail.rcn.net [207.172.4.62])
	by dkuug.dk (8.9.2/8.9.2) with ESMTP id PAA26147
	for <sc22wg5@dkuug.dk>; Thu, 30 Mar 2000 15:13:58 +0200 (CEST)
	(envelope-from dnagle@erols.com)
Received: from 216-164-139-221.s475.tnt5.lnhva.md.dialup.rcn.com ([216.164.139.221] helo=satellite)
	by smtp03.mrf.mail.rcn.net with smtp (Exim 2.12 #3)
	id 12aelo-00026g-00
	for sc22wg5@dkuug.dk; Thu, 30 Mar 2000 08:13:57 -0500
From: Dan Nagle <dnagle@erols.com>
Date: Thu, 30 Mar 2000 13:13:29 GMT
Message-ID: <20000330.13132972@mis.configured.host>
Subject: Re: (SC22WG5.1755) Semantics of the SIZE intrinsic
To: sc22/wg5 members <sc22wg5@dkuug.dk>
In-Reply-To: <200003301231.OAA25937@dkuug.dk>
References: <200003301231.OAA25937@dkuug.dk>
X-Mailer: Mozilla/3.0 (compatible; StarOffice/5.1; Win32)
X-Priority: 3 (Normal)
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by dkuug.dk id PAA26147

Hello,

SIZE of a zero sized array is zero.

Should SIZE of a disassociated array be zero or negative
(an impossible value)?  That is, should SIZE distinguish
between a pointer to a zero sized array and a
disassociated pointer?

Agreed that a POINTER or ALLOCATABLE array should be
able to be initialized with a zero sized array.

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 3/30/00, 7:31:35 AM, Lawrie Schonfelder 
<j.l.schonfelder@liverpool.ac.uk> wrote regarding (SC22WG5.1755) 
Semantics of the SIZE intrinsic:


> 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

-- 
Cheers!

Dan Nagle, eMail: dnagle@erols.com
Purple Sage Computing Solutions, Inc.,
12142 Purple Sage Ct., Reston VA 20194




