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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,642c983bc89db880 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!k39g2000hsf.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: pragma Pack vs. Convention C, portability issue? Date: Fri, 11 Jan 2008 16:35:15 -0800 (PST) Organization: http://groups.google.com Message-ID: <8cbe61c3-4002-4550-b051-53d7b7448bde@k39g2000hsf.googlegroups.com> References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1200098116 26043 127.0.0.1 (12 Jan 2008 00:35:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 12 Jan 2008 00:35:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k39g2000hsf.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19334 Date: 2008-01-11T16:35:15-08:00 List-Id: On Jan 11, 11:53 am, "(see below)" wrote: > On 11/1/08 04:20, in article fm8e95$q0...@jacob-sparre.dk, > > "Randy Brukardt" wrote: > > > Moral: avoid Pack for anything where the representation matters to > > portability. Use 'Component_Size instead. > > What is the view on combinations like this: > > type seive is array (pos_integral range <>) of Boolean; > for seive'component_size use 8; > pragma pack(seive); > > or even this: > > type a_set is array (a_member) of Boolean; > for a_set'Component_Size use 1; > pragma Pack(a_set); > pragma Convention(C, Entity => a_set); 13.2(9) makes me think that the 'Component_Size clause is honored and the Pack pragma can't change it. -- Adam