comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Green Hiils AdaMULTI 2000 -> Motorola Coldfire
Date: Thu, 11 Jan 2001 20:51:44 GMT
Date: 2001-01-11T20:51:44+00:00	[thread overview]
Message-ID: <93l6cr$pcq$1@nnrp1.deja.com> (raw)
In-Reply-To: 3A5DC6D5.5A8446D8@hercii.mar.lmco.com

In article <3A5DC6D5.5A8446D8@hercii.mar.lmco.com>,
  Brian Courtney <bcourtn@hercii.mar.lmco.com> wrote:

> A misunderstanding by the developers, or an oversight in the
> language? Either way, this issue has plagued more than one
> project, so it may be something you want to be on the lookout
> for.

We decided early on in the GNAT project that we would always
make the object size of subtypes the same as the parent size.
Otherwise the incompatibilities with Ada 83 in practice get
very fierce. The SIZE design in Ada 95 is flawed, in that it
simply did not very well understand the purpose or typical
usage of this attribute and the typical behavior of Ada 83
compilers.

Yes, in a formal sense, Ada 95 just chose one possible
semantics for sizes that was formally permitted by Ada 83,
but the only trouble was that the choice was different from
all commonly used Ada 83 compilers.

In GNAT, we do make sure that the allocation of objects is
typically the same as Ada 83 compilers, and we also provide
the Object_Size attribute to override this assumption on a
subtype specific basis if necessary.

However, we are bound by the (unfortunate) rules on the 'Size
attribute, which for example require that Natural'Size be 31,
when nearly all (all in common use?) Ada 83 compilers gave
32 for Natural'Size.

In GNAT, we also provide the 'VADS_Size attribute that gives
the same value for the Size attribute that VADS would have
given, and even more radical, the Use_VADS_Size pragma which
causes *all* size attribute to be treated as VADS_Size. Pretty
ugly, but in extreme cases of difficulty in porting old code
covered with assumptions about SIZE, useful :-)


Sent via Deja.com
http://www.deja.com/



  reply	other threads:[~2001-01-11 20:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-10 20:26 Green Hiils AdaMULTI 2000 -> Motorola Coldfire Mark Fisher
2001-01-11  8:56 ` Martin Dowie
2001-01-11 14:03   ` Tucker Taft
2001-01-11 14:22     ` Martin Dowie
2001-01-11 20:47       ` Larry Kilgallen
2001-01-11 14:44 ` Brian Courtney
2001-01-11 20:51   ` Robert Dewar [this message]
2001-01-12 13:18   ` Marc A. Criley
2001-01-12 17:44     ` 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