comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <dewar@gnat.com>
Subject: Re: 3-bit array porting problem from ADA83 to GreenHills ADA95
Date: 1999/11/06
Date: 1999-11-06T00:00:00+00:00	[thread overview]
Message-ID: <801gd2$ifa$1@nnrp1.deja.com> (raw)
In-Reply-To: 382386fe.85782690@news.uswest.net

In article <382386fe.85782690@news.uswest.net>,
  darrellhiggins@uswest.net (Darrell Higgins) wrote:
> Has anybody dealt (successfully) with a port of ADA83 that
> contains 3-bit arrays of enumerated types into GH ADA95?
> GreenHills does not support 3-bit arrays and we are searching
> for techniques/solutions to achieve this port.

The Ada 95 RM (in my opinion) dumbs down the language compared
to Ada 83 in terms of what is required in rep specs. In Ada 83,
you were required to implement anything that could be reasonably
easily implemented at the hardware level.

This was of course vague and lead to differences between
compilers.

But in Ada 95, the decision was

a) to make the requirements clearer

b) to limit them to the intersection of things that can be
done easily on ALL architectures.

This means that the required set of rep clauses is really rather
thin in Ada 95, and many Ada 83 legacy programs will contain
perfectly reasonable rep clauses that are NOT required to be
accepted by Ada 95 compilers.

This is one particular example, on typical architectures, the
RM only requires array packing for 1,2 and 4 bits.

Of course this does not stop a compiler going further than the
minimum, and in GNAT, we implement close packing for all
component sizes up to 63 bits.

If you really want to constrain yourself to what is required
to be implemented in the Ada 95 RM, that really in practice
restricts the language pretty severely compared to typical
Ada 83 implementations. We have certainly found in GNAT that
we needed to do a LOT in terms of adding rep clause capabilities
to this minimum set in order to accomodate not only legacy
code from Ada 83 compilers, but also new code with flexible
data structuring requirements not accomodated by the minimum
guarantees of the Ada 95 RM.

Note that actually an Ada 95 compiler is not *required* to
implement rep clauses at all, since the actual requirements,
thin as they are, are in an optional annex.

That means that in any case you need to specify more than just
Ada 95 if you want to use rep clauses at all. Once you get in
the business of applying additional requirements to compilers
beyond basic conformance with the standard, you may as well
require them to have exactly the capabilities you need in this
area, since you are not writing 100% portable code in any case.

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.




  parent reply	other threads:[~1999-11-06  0:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-06  0:00 3-bit array porting problem from ADA83 to GreenHills ADA95 Darrell Higgins
1999-11-05  0:00 ` Jeff Creem
1999-11-06  0:00   ` Darrell Higgins
1999-11-06  0:00 ` Robert Dewar [this message]
1999-11-09  0:00 ` Steve Mossom
1999-11-09  0:00   ` Robert Dewar
1999-11-10  0:00 ` Gleason
1999-11-10  0:00   ` Ted Dennison
1999-11-10  0:00     ` David Botton
1999-11-12  0:00       ` Robert Dewar
1999-11-12  0:00         ` Preben Randhol
1999-11-14  0:00         ` David Botton
1999-11-13  0:00 ` Darrell Higgins
1999-12-03  0:00 ` Darrell Higgins
1999-12-02  0:00   ` Robert C. Leif, Ph.D.
1999-12-04  0:00     ` Robert Dewar
1999-12-03  0:00   ` 3-bit array Nick Roberts
1999-12-05  0:00     ` Gisle S�lensminde
1999-12-06  0:00     ` Robert A Duff
1999-12-06  0:00       ` Tucker Taft
1999-12-07  0:00       ` Robert Dewar
1999-12-07  0:00         ` Tucker Taft
1999-12-08  0:00           ` Robert Dewar
1999-12-08  0:00           ` Robert C. Leif, Ph.D.
1999-12-07  0:00         ` Robert A Duff
replies disabled

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