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-Language: ENGLISH,ASCII X-Google-Thread: 103376,971aa11c293c3db1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-20 05:41:47 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!195.27.83.146!news-FFM2.ecrc.net!news.iks-jena.de!lutz From: lutz@iks-jena.de (Lutz Donnerhacke) Newsgroups: comp.lang.ada Subject: Re: Ada The Best Language? Date: Fri, 20 Jul 2001 12:39:28 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <5be89e2f.0107170838.c71ad61@posting.google.com> <5be89e2f.0107180235.726d46a8@posting.google.com> <3B55B01A.DAC06D79@icn.siemens.de> <5be89e2f.0107181248.73298c57@posting.google.com> <9j949b$1ujp$1@norfair.nerim.net> <9j983r$20jq$1@norfair.nerim.net> NNTP-Posting-Host: taranis.iks-jena.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: branwen.iks-jena.de 995632768 24519 217.17.192.37 (20 Jul 2001 12:39:28 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Fri, 20 Jul 2001 12:39:28 +0000 (UTC) User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.lang.ada:10326 Date: 2001-07-20T12:39:28+00:00 List-Id: * Bertrand Augereau wrote: >"Lutz Donnerhacke" a �crit dans le message news: >> https://www.iks-jena.de/mitarb/lutz/ada/net/net-packet-ip-v4__ads.htm > >Ok, that's what I was thinking about but I had to be sure. >In fact C++ bitfields allow you to pack information exactly (well almost >exactly, you have to take care of the offset with appropriate padding, but >bitfields take care of the 'range') this way in your ADT. This is almost >equivalent. Please specify the C++ Code for offset 6. [...] dont_fragment at 6 range 6 .. 6; more_fragments at 6 range 5 .. 5; offset1 at 6 range 0 .. 4; [...] Ada95 still have problems, there is no portable way to specify the layout of the whole 12bit offset. >But I'm not sure of endianness consideration in both cases, especially for >network code. https://www.iks-jena.de/mitarb/lutz/ada/net/net-portability__adb.htm It's horrible ugly, but compile time evaluable and the generated code is incredibly fine. Ever seen a Compiler generating an endian prefix on alpha?