From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38ceb882eed41e1e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-31 19:50:23 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: Size and pack Date: Wed, 31 Oct 2001 22:53:38 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <9ff447f2.0110100005.2503bb00@posting.google.com> <3BC40DF2.9447F025@icn.siemens.de> <3bc41989.4285341@news.demon.co.uk> <5ee5b646.0110301750.38ba5bfd@posting.google.com> <9ff447f2.0110311758.2be52637@posting.google.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:15525 Date: 2001-10-31T22:53:38-05:00 List-Id: "Adrian Hoe" wrote in message news:9ff447f2.0110311758.2be52637@posting.google.com... > "Jeff Creem" wrote in message news:... > > for example, the code fragment > > > > type My_Type is range 0 .. 3; > > for My_Type'size use 2; > > > > type My_Array is array (1 .. 4) of My_Type; > > pragma Pack (My_Array); -- Without this the following could fail > > for My_Array'size use 8; > > > > > > The pragma pack is needed I believe because the rep spec on My_Array can > > be rejected without it Why aren't you (Jeff) specifying the array component size? for My_Array'Component_Size use 2; Won't that eliminate the need for the pragma Pack? Furthermore, isn't the size clause for My_Type redundent? The size of a type is the number of bits needed to represent all values in the type, which is 2 bits.