comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Question about package Interfaces.
Date: Tue, 14 Sep 2010 08:33:14 +0200
Date: 2010-09-14T08:33:14+02:00	[thread overview]
Message-ID: <i6n4vc$a9$1@news.eternal-september.org> (raw)
In-Reply-To: <4c8e2be0$0$2414$4d3efbfe@news.sover.net>

Le 13/09/2010 15:47, Peter C. Chapin a �crit :
> On 2010-09-12 23:54, Robert A Duff wrote:
> 
>> Unsigned_8'Size = 8.  But that does not mean that all objects
>> of subtype Unsigned_8 are 8 bits, nor that X'Size = 8
>> (where "X: Unsigned_8;").  For example, an object could
>> be stored in a 64-bit register.
>>
>> A packed array A of Unsigned_8 will have A'Component_Size = 8,
>> and A(I)'Size = 8 for all I.
> 
> So I have to explicitly ask for a packed array in order to get this
> guarantee? 
I don't know exactly what you want to achieve, but bear in mind that
talking about the size of a single variable is meaningless.

Imagine that you declared:
X : Unsigned_8;
and you discover that the declaration advances the data counter by 4
bytes. You can interpret that as X occupying 32 bits, or as X occupying
only 8 bits with 3 unused padding bytes ahead of it.

There is positively no way to tell the difference.
-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



  parent reply	other threads:[~2010-09-14  6:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13  1:10 Question about package Interfaces Peter C. Chapin
2010-09-13  3:54 ` Robert A Duff
2010-09-13 13:47   ` Peter C. Chapin
2010-09-13 14:15     ` Robert A Duff
2010-09-13 18:31       ` Peter C. Chapin
2010-09-13 22:47         ` Robert A Duff
2010-09-14  6:33     ` J-P. Rosen [this message]
2010-09-14 16:36       ` Jeffrey Carter
2010-09-14 17:01         ` J-P. Rosen
replies disabled

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