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,febd9e55846c9556 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-04 08:56:50 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!news.tufts.edu!uunet!dca.uu.net!ash.uu.net!xyzzy!nntp From: John Harbaugh Subject: Re: Endianness independance X-Nntp-Posting-Host: e245845.nw.nos.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3E64D689.B9230922@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: Mime-Version: 1.0 Date: Tue, 4 Mar 2003 16:38:33 GMT X-Mailer: Mozilla 4.73 [en]C-CCK-MCD Boeing Kit (Windows NT 5.0; U) Xref: archiver1.google.com comp.lang.ada:34863 Date: 2003-03-04T16:38:33+00:00 List-Id: If you are looking for an implementation that is platform and compiler independent, take a look at the December 1999 Ada Letters. Mike Mardis wrote a very good article titled "Endian-Safe Record Representation Clauses for Ada Programs." Cheers, - John Harbaugh "David C. Hoos, Sr." wrote: > > ----- Original Message ----- > From: > To: > Sent: March 04, 2003 5:34 AM > Subject: RE: Endianness independance > > > > > > > | -----Message d'origine----- > > | De: David C. Hoos [mailto:david.c.hoos.sr@ada95.com] > > ... > > | Yes, Glade does it, but the only thing Glade has to worry > > | about is that > > | the stream representation is independent of hardware platform and OS. > > | > > | Glade does this by providing a replacement body for the > > | System.Stream_Attributes package. > > | > > | However, I have done a lot of endianess-independent work where a > > | specific network representation is required -- i.e., where an Ada > > | program has to communicate with a program writen in a language > > | not necessarily known to me. > > | > > OK, but i don't pretend to get this general case taken into account within > > the language scope, altrough some > > for My_Stream'representation use XDR; > > could be great! > > > > My point is just about interoperability between the same Ada code compiled > > on two platform. I want both exe to put the same thing in the stream. > > It's not the case even with a representation clause, and i feel this is > > abnormal. > > I know it's far from easy to achieve, but i thought Norman's proposal was > > helping a lot... > > > Representation clauses are neither the issue, nor the answer to the problem. > > If all you want is platform-independence, then replace the file s-stratt.adb > in your standard gnat distribution with the one from the same version of > glade, and re-compile and rebuild the library files (.a), and you have > what you want. Now, as long as your types are declared the same on both > platforms (with no representation clauses) you will have platform- > independence. > > I'm not sure why GNAT didn't do this from the beginning -- perhaps because > they didn't provide an implementation of the Distributed Systems Annex at > the beginning. Also, there is a small performance penalty paid for > shuffling bits around to achieve platform independence. >