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=-0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLY autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7345e706c651a1a3 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!out01a.usenetserver.com!news.usenetserver.com!in01.usenetserver.com!news.usenetserver.com!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsinpeer00.lnd.ops.eu.uu.net!emea.uu.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: pragma Pack does not work on GNAT 5.01a for Redhat Linux. Date: Fri, 22 Jun 2007 06:20:55 +0100 Organization: Pushface Message-ID: References: <1182259013.590515.118310@g4g2000hsf.googlegroups.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1182489655 19522 62.49.19.209 (22 Jun 2007 05:20:55 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 22 Jun 2007 05:20:55 +0000 (UTC) Cancel-Lock: sha1:+6AS95bPskDQ+tispQGf2yPdds8= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin) Xref: g2news1.google.com comp.lang.ada:16291 Date: 2007-06-22T06:20:55+01:00 List-Id: "Bob Spooner" writes: > "Simon Wright" 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?)