comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Binary files vs Portablity vs Ada
Date: 1999/11/06
Date: 1999-11-06T00:00:00+00:00	[thread overview]
Message-ID: <7vvrin$gp9$1@nnrp1.deja.com> (raw)
In-Reply-To: 7vuto0$pv0$1@nnrp1.deja.com

In article <7vuto0$pv0$1@nnrp1.deja.com>,
  Ted Dennison <dennison@telepath.com> wrote:
> There's no reason to
> expect that your vendor would do something goofy with the data
> (like compress it or something), but there's nothing stopping
> them either.

This is unnecessary FUD :-)

There is specific implementation advice on this subject:

                            Implementation Advice

17   If a stream element is the same size as a storage element,
then the normal in-memory representation should be used by Read
and Write for scalar objects.  Otherwise, Read and Write should
use the smallest number of stream elements needed to represent
all values in the base range of the scalar type.

Now an implementation could conceivably refuse to follow this
implementation advice, but then it must document this fact:

1   The Ada language allows for certain machine dependences in a
controlled manner.  Each Ada implementation must document all
implementation-defined characteristics:

    2  Whether or not each recommendation given in
       Implementation Advice is followed.  See 1.1.2(37).

So if you are really worried by Ted's concerns, then just check
your compiler documentation, for GNAT for example you will find:

@cindex Stream oriented attributes
@item 13.13.2(17): Stream Oriented Attributes

... (repeat of quote above)

Followed.

Reassuring you that GNAT does not do crazy things. Note that
if you start worrying about craziness at this level, almost
no compiler is useful for anything :-)


> I believe that's probably against the LRM (It says
> elements are written in "cannonical" order),

yes it's a plain bug!!!

>  but the point is that
> unless you write everything yourself, the only thing you can
really
> count on when you are using default stream implementations is
that 'Read
> will be able to retrieve what 'Write wrote, if both were
compiled with
> the same compiler on the same platform.

No, that's too pessimistic.


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~1999-11-06  0:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-04  0:00 Binary files vs Portablity vs Ada John Halleck
1999-11-05  0:00 ` Robert Dewar
1999-11-05  0:00   ` Ted Dennison
1999-11-06  0:00     ` Robert Dewar [this message]
1999-11-08  0:00       ` Ted Dennison
1999-11-08  0:00         ` Tucker Taft
1999-11-09  0:00           ` Robert Dewar
1999-11-09  0:00         ` Robert A Duff
1999-11-09  0:00           ` Advice, or *Advice*? (was: Binary files vs Portablity vs Ada) Ted Dennison
1999-11-10  0:00             ` Robert A Duff
1999-11-09  0:00         ` Binary files vs Portablity vs Ada Robert Dewar
1999-11-05  0:00 ` Larry Kilgallen
1999-11-05  0:00   ` John Halleck
1999-11-05  0:00 ` Matthew Heaney
1999-11-08  0:00 ` Nick Roberts
1999-11-09  0:00   ` Ted Dennison
1999-11-09  0:00   ` Robert Dewar
replies disabled

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