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,5ae752c88e0dde5e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news1.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 From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Using representation clauses in networking software References: <8739ugqfeb.fsf@mid.deneb.enyo.de> <43fkp7an4c5m$.3db3n6adym42.dlg@40tude.net> Date: Mon, 16 Aug 2010 06:57:46 -0400 Message-ID: <82eidyvn85.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (windows-nt) Cancel-Lock: sha1:3DLc6elRUeUdO6DV+D+cvPGvC7A= 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: ed1cc4c69199ee029e66117117 Xref: g2news1.google.com comp.lang.ada:13397 Date: 2010-08-16T06:57:46-04:00 List-Id: "Dmitry A. Kazakov" writes: > On Sun, 15 Aug 2010 15:44:34 +0200, Yannick DuchĂȘne (Hibou57) wrote: > > (I agree with what you wrote. I am programming a lot of communication > stuff, but never used representation clauses to handle endianness.) > >> I do not know neither any representation clause for Byte Ordering. > > Byte ordering is what S'Bit_Ordering is, when bytes are addressable. Not exactly. > IMO, Bit_Ordering was an unfortunate choice. The attribute name suggests > ordering of bits in some machine storage unit, which it is not. Bit_ordering specifies how to interpret the bit numbers in Ada record representation clauses. The restriction of 'Bit_Order only being valid for the target endianness was removed in Ada 2005. It is useful for representing record layouts that may be used in systems with different byte orders. See http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ais/ai-00133.txt?rev=1.17 for a good discussion. The concept of 'machine scalars' is important. Only part of this discussion made it into the ARM or AARM, so they are hard to understand. Still, S'Bit_ordering does _not_ solve the inter-machine byte endianness problem. It could be part of a solution. -- -- Stephe