comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@linus.mitre.org (Robert I. Eachus)
Subject: Re: File Format Compatibility between different compilers
Date: 8 Jun 90 19:51:22 GMT	[thread overview]
Message-ID: <EACHUS.90Jun8155122@aries.linus.mitre.org> (raw)
In-Reply-To: casado@enstb.enst-bretagne.fr's message of 6 Jun 90 08:19:13 GMT

In article <313@enstb.enst-bretagne.fr> casado@enstb.enst-bretagne.fr (casado) writes:

> The problems detected were to read meaningless data when the file
> has been created by a program that was compiled by a different compiler.

> Has anybody tried this scenario?

    This is a very good question, but not an easy one to answer. What
an external file looks like is not in the domain of the Ada standard
(there are other ANSI and ISO standards on the subject), and therefore
it is difficult for the RM to mandate a bit layout in an external
file.  Most Ada compiler vendors do a good job of mapping TEXT_IO onto
the standard text file formats for a particular architecture, but when
it come to DIRECT_IO and SEQUENTIAL_IO the situation gets much
messier.

    The easiest thing for a compiler to do is to provide generic IO
packages which copy the internal representations of objects to
external files unchanged.  However different vendors will layout the
same record type differently even on the same hardware, but the bigger
differences are in two different ways to handle discriminated records
and unconstrained array objects.

     Defining a record type EXACTLY with representation clauses is
often enough to make files portable between compilers, but I have had
trouble getting ANSI standard text files from a VAX running VMS to a
VAX running Ultrix, even when using ANSI standard labelled tapes.
--

					Robert I. Eachus

with STANDARD_DISCLAIMER;
use  STANDARD_DISCLAIMER;
function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...

      reply	other threads:[~1990-06-08 19:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-06-06  8:19 File Format Compatibility between different compilers casado
1990-06-08 19:51 ` Robert I. Eachus [this message]
replies disabled

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