comp.lang.ada
 help / color / mirror / Atom feed
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
Date: 1997-02-18T00:00:00+00:00	[thread overview]
Message-ID: <dewar.856269469@merv> (raw)
In-Reply-To: 33087143.36F9@elca-matrix.ch


Mats said

<<In the standard, they are given as

   type Fortran_Integer is range <implementation defined>;

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.





  reply	other threads:[~1997-02-18  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-12  0:00 VMS to Unix (was: Is there a Fortran to Ada translator) W. Wesley Groleau (Wes)
1997-02-16  0:00 ` Oliver Kellogg
1997-02-17  0:00   ` Robert Dewar
1997-02-17  0:00   ` Mats Weber
1997-02-18  0:00     ` Robert Dewar [this message]
1997-02-26  0:00     ` Oliver Kellogg
replies disabled

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