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,d778a4f52acd9d43 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.190.71 with SMTP id go7mr9479388pbc.8.1324604573311; Thu, 22 Dec 2011 17:42:53 -0800 (PST) MIME-Version: 1.0 Path: lh20ni53643pbb.0!nntp.google.com!news1.google.com!goblin2!goblin1!goblin.stu.neva.ru!news.tornevall.net!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Representation clauses for base-64 encoding Date: Thu, 22 Dec 2011 19:42:50 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <4ef31672$0$6574$9b4e6d93@newsspool3.arcor-online.net> <9lgls6FticU1@mid.individual.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1324604572 5908 69.95.181.76 (23 Dec 2011 01:42:52 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 23 Dec 2011 01:42:52 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2011-12-22T19:42:50-06:00 List-Id: "Niklas Holsti" wrote in message news:9lgls6FticU1@mid.individual.net... ... >> http://www.adacore.com/2008/03/03/gem-27/ > > I am surprised and disappointed that there is *no* mention of portability > problems in that "gem". This is marketing hype for GNAT, not sound > programming advice. There is no portability problem in common use. For instance, Natasha's code (once the rep. clauses are right) will work on both a big-endian and little-endian machine without change. (And yes, I'd use the record rep. clauses to do this conversion; I think I have some code that looks very much like his sample.) The problem occurs when you need to process big-endian data on a little-endian machine (or vice versa). That is not that common of a need -- it surely happens (as in your application), but you are overstating it if you think most programs would run into it. Most code does not care which bits are which bits in the word -- like this encoding code -- they just need a consistent representation. That is, it doesn't matter where bit 0 is, so long as it is the same in every item that is processed. Randy.