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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8201deea80f1752a X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: 3-bit array porting problem from ADA83 to GreenHills ADA95 Date: 1999/11/06 Message-ID: <801gd2$ifa$1@nnrp1.deja.com>#1/1 X-Deja-AN: 545199657 References: <382386fe.85782690@news.uswest.net> X-Http-Proxy: 1.0 x25.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sat Nov 06 15:10:27 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-11-06T00:00:00+00:00 List-Id: 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.