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 18:35:38 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!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 02:34:15 GMT NNTP-Posting-Host: 24.61.92.65 X-Complaints-To: abuse@mediaone.net X-Trace: typhoon.ne.mediaone.net 1004582055 24.61.92.65 (Wed, 31 Oct 2001 21:34:15 EST) NNTP-Posting-Date: Wed, 31 Oct 2001 21:34:15 EST Organization: Road Runner Xref: archiver1.google.com comp.lang.ada:15523 Date: 2001-11-01T02:34:15+00:00 List-Id: See..I knew it was too early when I wrote that. I checked and GNAT rejects it as well without the pragma pack. VADS allowed it however that was an Ada 83 implementation. In any case I stand by my basic premise that Roberts response was correct when limited to the scope of the thread (which was talking about record rep clauses) however it was too broad when taken out of context since the pragma pack should indeed by used on the array when one wants to pack the items of the array. As for the "Standardization" troll comment..There are many things in the standard that are not directly specified or are specified in terms of dependencies on the host architecture. (Word size, etc).. This is not Java. There is no standard Ada virtual machine that forces all applications to run 5-30 times slower than a native implementation (see I can troll too!). "Adrian Hoe" wrote in message news:9ff447f2.0110311758.2be52637@posting.google.com... > "Jeff Creem" wrote in message news:... > > OK.. I know I am going to regret this since whenever I question Robert I > > usually am wrong however > > without using the complete context of this thread, I believe Roberts > > statement is actually > > a little too broad. There ARE indeed times when you want a pragma pack and a > > rep spec. Not for the record case but for arrays of items that have been rep > > spec'ed. > > > > 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 (At least it has been rejected by some compilers and > > I forget > > the exact rule but it had something to do with the final rep spec not being > > allowed to > > change the layout of the items within the array). > > > > Having said that VADS used to compile this without the pragma pack. Green > > Hills did not. > > I *THINK* GNAT does allow it to go through without the rep spec for several > > versions now. > > > But, why the differenct implementation by these compilers' vendors? I > thought Ada is a standardized language regardless of platforms. Of > course, a problem like whether to use "pragma pack" or not in the > above Jeff's example "supposed" not to arise if Ada is standardized. > > Oh... I am getting quite confusing now, and not to mention Ada > newbies! > > > > > > > "Robert Dewar" wrote in message > > news:5ee5b646.0110301750.38ba5bfd@posting.google.com... > > > john.mccabe@emrad.com.nospam (John McCabe) wrote in message > > news:<3bc41989.4285341@news.demon.co.uk>... > > > > Your best bet would be to use as many representation attributes as are > > > > necessary. In general I would use both a representation clause and > > > > pragma pack > > > > > > No, that's pointless, if you use a complete rep clause, then it is > > > redundant to use pragma Pack since it won't have > > > any effect.