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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!aplcen!samsung!xylogics!merk!alliant!linus!eachus From: eachus@linus.mitre.org (Robert I. Eachus) Newsgroups: comp.lang.ada Subject: Re: File Format Compatibility between different compilers Message-ID: Date: 8 Jun 90 19:51:22 GMT References: <313@enstb.enst-bretagne.fr> Sender: usenet@linus.mitre.org Organization: The Mitre Corporation, Bedford, MA In-reply-to: casado@enstb.enst-bretagne.fr's message of 6 Jun 90 08:19:13 GMT List-Id: 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...