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-11-01 10:38:32 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!chnws02.mediaone.net!chnws06.ne.mediaone.net!24.128.8.70!typhoon.ne.mediaone.net.POSTED!not-for-mail From: "Jeff Creem" Newsgroups: comp.lang.ada 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> Subject: Re: Size and pack 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 Message-ID: Date: Thu, 01 Nov 2001 18:37:18 GMT NNTP-Posting-Host: 24.61.92.65 X-Complaints-To: abuse@mediaone.net X-Trace: typhoon.ne.mediaone.net 1004639838 24.61.92.65 (Thu, 01 Nov 2001 13:37:18 EST) NNTP-Posting-Date: Thu, 01 Nov 2001 13:37:18 EST Organization: Road Runner Xref: archiver1.google.com comp.lang.ada:15564 Date: 2001-11-01T18:37:18+00:00 List-Id: I tend to avoid 'component size since a lot of my code needs to compile on Ada 83 and Ada 95. The pragma pack followed by the confirmatory 'size clause on the overall array should force the compiler to do what I want and if it does not (because it ignores the pragma) it will reject the final rep spec on the array. So the final 'size is not redundant. "Matthew Heaney" wrote in message news:tu1hjutp4bdgf7@corp.supernews.com... > > "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. > > > > >