comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter C. Chapin" <pcc482719@gmail.com>
Subject: Re: Null Range in Unconstrasined Array
Date: 06 Sep 2009 12:11:05 GMT
Date: 2009-09-06T12:11:05+00:00	[thread overview]
Message-ID: <Xns9C7E535487F4Bpcc482719gmailcom@198.186.192.137> (raw)
In-Reply-To: wcc4ormhe61.fsf@shell01.TheWorld.com

Robert A Duff <bobduff@shell01.TheWorld.com> wrote in 
news:wcc4ormhe61.fsf@shell01.TheWorld.com:

> Randy's reason applies only if the array is aliased,
> which the above one is not.  There's no reason the compiler 
> has to allocate any space for My_Array above.
> 
> If we have:
> 
>     My_Array : My_Array_Type (1 .. 0);
>     X : Boolean;
> 
> it is entirely possible (likely even) that My_Array'Address = X'Address.


Wouldn't it be possible to pass My_Array to a subprogram expecting 
My_Array_Type? The subprogram might consult the bounds on the formal 
parameter before trying to use the array so sending a null array to such a 
subprogram is not automatically going to cause a problem. In that case, it 
seems like My_Array needs to have memory allocated for it to hold 
information about the bounds.

Peter



  reply	other threads:[~2009-09-06 12:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01  1:28 Null Range in Unconstrasined Array Rick
2009-09-01  3:11 ` Randy Brukardt
2009-09-01 14:50 ` Adam Beneschan
2009-09-01 15:34   ` Robert A Duff
2009-09-06 12:11     ` Peter C. Chapin [this message]
2009-09-06 12:41       ` Robert A Duff
2009-09-08 17:54         ` Adam Beneschan
2009-09-09  8:35           ` Stephen Leake
2009-09-09 13:00             ` Robert A Duff
2009-09-09 19:22             ` sjw
2009-09-10 23:24               ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox