comp.lang.ada
 help / color / mirror / Atom feed
From: John Harbaugh <john.s.harbaugh2@boeing.com>
Subject: Re: Endianness independance
Date: Tue, 4 Mar 2003 16:38:33 GMT
Date: 2003-03-04T16:38:33+00:00	[thread overview]
Message-ID: <3E64D689.B9230922@boeing.com> (raw)
In-Reply-To: mailman.26.1046782013.1343.comp.lang.ada@ada.eu.org

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: <Lionel.DRAGHI@fr.thalesgroup.com>
> To: <comp.lang.ada@ada.eu.org>
> 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.
>



  reply	other threads:[~2003-03-04 16:38 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BB06F6B19AC7D51181D10050DA725A10138C75@eoleclb.clb.tcfr.thales>
2003-03-04 12:46 ` Endianness independance David C. Hoos, Sr.
2003-03-04 16:38   ` John Harbaugh [this message]
2003-03-04 21:25   ` Simon Wright
2003-03-05 17:28     ` Warren W. Gay VE3WWG
2003-03-05 20:15       ` Simon Wright
2003-03-05 21:54         ` Warren W. Gay VE3WWG
2003-03-05 17:49 David C. Hoos
2003-03-05 20:16 ` Simon Wright
2003-03-05 21:58   ` Warren W. Gay VE3WWG
  -- strict thread matches above, loose matches on Subject: below --
2003-03-04 11:34 Lionel.DRAGHI
     [not found] <BB06F6B19AC7D51181D10050DA725A10138C71@eoleclb.clb.tcfr.thales>
2003-03-03 18:38 ` David C. Hoos
2003-03-03 17:52 Lionel.DRAGHI
2003-03-03 20:29 ` Pascal Obry
2003-03-03 13:33 Lionel.DRAGHI
2003-03-03 16:11 ` Stephen Leake
2003-02-28 17:21 Lionel.DRAGHI
2003-02-28 20:37 ` Randy Brukardt
2003-02-28 15:11 Lionel.DRAGHI
2003-02-28 16:10 ` Stephen Leake
2003-02-28 18:26 ` Marin David Condic
2003-03-01 10:48   ` Amir Yantimirov
2003-03-01 12:00     ` Simon Wright
2003-03-01 12:53       ` Jeffrey Creem
2003-03-01 17:26         ` Simon Wright
2003-03-01 12:47     ` Marin David Condic
2003-03-02  9:49       ` Amir Yantimirov
2003-03-03 13:29         ` Marin David Condic
2003-03-03 16:05       ` Stephen Leake
2003-03-03 17:50         ` Marin David Condic
2003-03-04  2:33         ` Jeffrey Carter
2003-03-04 17:50           ` Stephen Leake
2003-03-05  2:15             ` Jeffrey Carter
2003-03-05 17:37               ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox