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 X-Received: by 2002:a6b:9c8f:: with SMTP id f137-v6mr2599401ioe.27.1526038818562; Fri, 11 May 2018 04:40:18 -0700 (PDT) X-Received: by 2002:a9d:5511:: with SMTP id l17-v6mr253229oth.14.1526038818106; Fri, 11 May 2018 04:40:18 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.linkpendium.com!news.linkpendium.com!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!v8-v6no401236itc.0!news-out.google.com!f20-v6ni418itd.0!nntp.google.com!u74-v6no416918itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 11 May 2018 04:40:17 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.233.194; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.233.194 References: <2821b8e0-2c64-4621-b65e-337027fc121e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: AI12-0218: What is the portable representation clause for processing IETF packets on little-endian machines? From: "Dan'l Miller" Injection-Date: Fri, 11 May 2018 11:40:18 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:52264 Date: 2018-05-11T04:40:17-07:00 List-Id: On Friday, May 11, 2018 at 4:40:19 AM UTC-5, Niklas Holsti wrote: > On 18-05-11 01:50 , Randy Brukardt wrote: >=20 > > Portable representation clauses are a waste of time, especially as mach= ines > > are inconsistent in the ways that they number bits. Just don't go there= . > > (218 solves one such problem, but there are many others.) >=20 > The ability to specify Bit_Order for record representations is very=20 > useful to me, as it allows my programs to be executed both on the target= =20 > HW (big-endian SPARC) and on the development workstations (little-endian= =20 > x86) with exactly the same HW-level input and output. >=20 > So thank you, ARG, for this! >=20 > There are some gotchas and limitations (most severe is the inability to= =20 > specify the ordering of the components of packed arrays within records)= =20 > but on the whole it works. >=20 > My current project has 115 cases of "for ...'Bit_Order use ...". >=20 > (And about three cases of having to manually expand packed arrays into=20 > individual record components because of the inability mentioned above.) >=20 > --=20 > Niklas Holsti > Tidorum Ltd > niklas holsti tidorum fi > . @ . Please provide an example of a Bit_Order-based-representation-clause record= that is portable between SPARC and IA-32/AMD64 (that is not utilizing the = GNAT feature in A12-0218, and completely ignoring the packed-array troubles= ome case). There is a perennial debate whether the =E2=80=A2proper=E2=80= =A2 usage of Bit_Order on =E2=80=A2bug-free=E2=80=A2 representation clauses= in an Ada compiler already solves the entire topic of A12-0218, making moo= t A12-0218 and GNAT's already-extant feature therein. Your long 115-cases = track-record of success with Bit_Order representation for endianness portab= ility between SPARC and IA-32/AMD64 seems to not only concur, but strongly = contains the wisdom necessary to decisively blow A12-0218 out of the water.= Please clearly lead us; please clearly teach us how to utilize Bit_Order = properly.