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: a07f3367d7,5a3e508f74e87110 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Record representation : components order References: <908a786e-214e-436f-868b-c0ead259fcc5@r33g2000yqn.googlegroups.com> From: Stephen Leake Date: Sun, 05 Jul 2009 10:10:57 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:PubnqFYpEZrQYCx5IwQT3aLC9l8= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 2b9394a50b47ce9cadf9d32503 Xref: g2news2.google.com comp.lang.ada:6841 Date: 2009-07-05T10:10:57-04:00 List-Id: "Hibou57 (Yannick Duchêne)" writes: > Going on in section 13, I did no see about record components order > apart the “ at X range Y .. Z ” which directly specify it. > > But looking at some design in some place in the web, people usually do > this way : define some component type with a size clause, and then, > just use these type in some records, most of time, without using any “ > at X range Y .. Z ” . But to me, this seems to be unsafe, beceause > components order is not guaranted to be that of the declaration. You are correct. If your application requires a specific component order, you must specify the order in a record representation clause. Anything else is compiler dependent. Note that Ada 2005 allows specifying bit field placement using endian-independent bit numbers. -- -- Stephe