comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon.j.wright@mac.com>
Subject: Re: pragma Pack does not work on GNAT 5.01a for Redhat Linux.
Date: Fri, 22 Jun 2007 06:20:55 +0100
Date: 2007-06-22T06:20:55+01:00	[thread overview]
Message-ID: <m28xacef9k.fsf@mac.com> (raw)
In-Reply-To: f5e38f$1ego$1@f04n12.cac.psu.edu

"Bob Spooner" <rls19@psu.edu> writes:

> "Simon Wright" <simon.j.wright@mac.com> wrote in message 
> news:m2hcp2e4fv.fsf@mac.com...
>>
>> There's always a price to pay, of course; the packing isn't dense, and
>> it can be quite a challenge to work out what bytes are actually being
>> sent (eg, if you find yourself having to talk to C after all).
>
> Yes, XDR takes care of things like endianness, etc. that otherwise get in 
> the way, but as you point out, there's always a price to be paid for 
> generality. In some cases it looks like it even will take care of differing 
> floating point representations, although I wonder about out of range 
> problems when converting. Isn't there an XDR library for C? I know that 
> there is one for Fortran. I would think that as long as you have an XDR 
> library for the language with which you need to communicate, you wouldn't 
> have to decode the bytes yourself; or have I misunderstood what you are 
> saying?

For us that was a big 'if'. There was a scripting language that didn't
understand anything beyond bytes on the wire, so you had to be pretty
conversant with the actual layouts used by the Ada. We used an
ASIS-based tool to work this out, but it's not well integrated into
the build process. Fortunately message definitions on the interfaces
where it matters don't change very often.

Another problem was that the message header had to contain the length
of the message body -- the easiest way to do that is of course to
construct the body first! (or perhaps a dummy message body during
program initialization/elaboration?)



  reply	other threads:[~2007-06-22  5:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-19 13:16 pragma Pack does not work on GNAT 5.01a for Redhat Linux petter_fryklund
2007-06-19 14:02 ` Georg Bauhaus
2007-06-19 14:15   ` petter_fryklund
2007-06-19 16:16 ` Jeffrey R. Carter
2007-06-19 16:23 ` Adam Beneschan
2007-06-20 15:51 ` Bob Spooner
2007-06-20 16:35   ` Adam Beneschan
2007-06-20 20:50   ` Simon Wright
2007-06-21 14:50     ` Bob Spooner
2007-06-22  5:20       ` Simon Wright [this message]
2007-06-29 10:21         ` Ole-Hjalmar Kristensen
2007-07-01 10:57           ` Simon Wright
2007-08-07 10:51             ` Ole-Hjalmar Kristensen
2007-08-10 20:36               ` Simon Wright
replies disabled

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