comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Question about package Interfaces.
Date: Mon, 13 Sep 2010 10:15:52 -0400
Date: 2010-09-13T10:15:52-04:00	[thread overview]
Message-ID: <wccbp81d90n.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 4c8e2be0$0$2414$4d3efbfe@news.sover.net

"Peter C. Chapin" <chapinp@acm.org> writes:

>> 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? Is that true even if I declare a component type with an
> explicit representation clause requesting an 8 bit size? I guess probably.

You can say "for A'Component_Size use 8;".  For records,
you can specify the size of each component.  For standalone
objects, you can specify 'Size.

But my point was just that the 'Size of an object
is not guaranteed to be the same as the 'Size of
its subtype.

You might want to look into the GNAT-specific
'Object_Size attribute.

- Bob



  reply	other threads:[~2010-09-13 14:15 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 [this message]
2010-09-13 18:31       ` Peter C. Chapin
2010-09-13 22:47         ` Robert A Duff
2010-09-14  6:33     ` J-P. Rosen
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