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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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 04:46:55 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.usenet-edu.net!usenet-edu.net!enst.fr!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: Endianness independance Date: Tue, 4 Mar 2003 06:46:15 -0600 Organization: ENST, France Message-ID: References: Reply-To: "comp.lang.ada mail to news gateway" NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1046782014 29130 137.194.161.2 (4 Mar 2003 12:46:54 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Tue, 4 Mar 2003 12:46:54 +0000 (UTC) To: "comp.lang.ada mail to news gateway" Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:34850 Date: 2003-03-04T06:46:15-06:00 ----- 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.