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-7-bit X-Google-Thread: 103376,d2cba5965c7bfcd5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-07 10:16:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!howland.erols.net!news.airnews.net!cabal10.airnews.net!cabal1.airnews.net!news-f.iadfw.net!usenet From: "John R. Strohm" Newsgroups: comp.lang.ada Subject: Re: 64bit access to an array of 8bit values Date: Thu, 7 Mar 2002 12:03:45 -0800 Organization: Airnews.net! at Internet America Message-ID: X-Orig-Message-ID: References: <3C823A1A.6030006@users.sf.net> <0CFB5EECF8614F8D.52C8F36A468D2F14.3AD3D533D2B72FDB@lp.airnews.net> <01D3EF1F744692CE.E4285A1E194C94B7.800ACE8F1D3EC3C7@lp.airnews.net> <482822EEF13389AC.7CF0F33D21F3D96D.C977F409C9057456@lp.airnews.net> Abuse-Reports-To: abuse at airmail.net to report improper postings NNTP-Proxy-Relay: library1-aux.airnews.net NNTP-Posting-Time: Thu Mar 7 12:15:24 2002 NNTP-Posting-Host: !bUsJ1k-WrVMJnq (Encoded at Airnews!) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:20909 Date: 2002-03-07T12:03:45-08:00 List-Id: "Jeffrey Creem" wrote in message news:Lnnh8.54694$%b6.13828382@typhoon.ne.ipsvc.net... > However, my initial concern still stands (and this is not just true here but > I've seen similar discussions crop up > on the C++ and other mailing lists)... The problem with the way the response > is phrased is people walk away with the understanding that they can not use > the simple straightforward approach in Ada so they have to resort to > something more complicated. In fact, the problems you point out are common > to all languages (with the possible exception of Java which always runs with > the same endianness regardless of host but then of course would probably now > allow the evil pointer arithmetic that seemed to be desired so perhaps in > that case the answer really could have been you can't do it like > that in XX lang). No. Let me try it again. The problem with the "simple straightforward approach", in Ada or in any other language, is that it MAY OR MAY NOT WORK. A "simple straightforward" solution that DOESN'T WORK is not a solution. Rather, it is a waste of time. In this case, the "simple straightforward approach" INHERENTLY inherits the endian-ness of the target machine, which MAY OR MAY NOT match the endianness of the simulated instruction set architecture. If the endiannesses do not match, the "simple straightforward approach" fails, forcing the programmer to spend much time scratching his head, wondering what went wrong, and then eventually figuring out that he has an endianness problem. Even if the language is specified to run with the same endianness, regardless of target architecture, requiring the compiler to generate appropriate byteswapping code, the "simple straightforward approach in Ada" STILL fails if the simulated instruction set architecture endianness does not match the language endianness. Part of the programmer's job is recognizing when the "simple straightforward approach", in Ada, or in any other language, might not work.