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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,13f9967aa564a834 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: VMS to Unix (was: Is there a Fortran to Ada translator) Date: 1997/02/18 Message-ID: #1/1 X-Deja-AN: 219616724 References: <9702121335.AA05019@most> <5e77gh$qp4$1@salyko.cube.net> <33087143.36F9@elca-matrix.ch> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-02-18T00:00:00+00:00 List-Id: Mats said <; and GNAT chose to derive them from the standard types instead of writing type Fortran_Integer is range Integer'First .. Integer'Last;>> Yes, and this decision was quite intentional. In GNAT working with g77, we expect type Integer in Ada to be the same as the standard integer type in Fortran, which is also the same type as int in C. Now we might come up against a target in the future where this is not the case, or where the vendor Fortran makes a different choice, and if so we will worry about how to specialize it then, but the default assumption is that the types are all the same, hence the use of derivation. Now of course it is true that *in GNAT* the declaration that Mats writes above with an explicit range is always identical in effect to deriving from Integer, but that is not generally required in Ada semantics (a compiler is allowed to choose any type that is large enough), so it seems clearer to state the intent by using a derived type. Note: we have run into one case so far where we had to break the nice correspondence of types, namely in the AXP VMS case, where the type Long_Integer in Ada is 64 bits, where as type long in C is 32 bits. Since we want to be super-compatible with DEC Ada, we go along with this decision to make Long_Integer 64 bits, even though it creates a conflict with the type long in C.