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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: AI12-0218: What is the portable representation clause for processing IETF packets on little-endian machines? Date: Fri, 11 May 2018 12:40:16 +0300 Organization: Tidorum Ltd Message-ID: References: <2821b8e0-2c64-4621-b65e-337027fc121e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 4RS0NPhXTstiU7o2SacfNwgSanfUI45eWeqRNgbZmDzo/6aX0Q Cancel-Lock: sha1:/gJNtQFR2jcuQKmw+1FGM2vv9b0= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Xref: reader02.eternal-september.org comp.lang.ada:52259 Date: 2018-05-11T12:40:16+03:00 List-Id: On 18-05-11 01:50 , Randy Brukardt wrote: > Portable representation clauses are a waste of time, especially as machines > are inconsistent in the ways that they number bits. Just don't go there. > (218 solves one such problem, but there are many others.) The ability to specify Bit_Order for record representations is very useful to me, as it allows my programs to be executed both on the target HW (big-endian SPARC) and on the development workstations (little-endian x86) with exactly the same HW-level input and output. So thank you, ARG, for this! There are some gotchas and limitations (most severe is the inability to specify the ordering of the components of packed arrays within records) but on the whole it works. My current project has 115 cases of "for ...'Bit_Order use ...". (And about three cases of having to manually expand packed arrays into individual record components because of the inability mentioned above.) -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .