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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,582882cfea9f35db X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-11 13:04:43 PST Path: supernews.google.com!sn-xit-02!supernews.com!204.127.161.2.MISMATCH!wn2feed!worldnet.att.net!128.230.129.106!news.maxwell.syr.edu!xmission!news.cc.utah.edu!newsfeed.cs.utexas.edu!galaxy.us.dell.com!news-feeds!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: Green Hiils AdaMULTI 2000 -> Motorola Coldfire Date: Thu, 11 Jan 2001 20:51:44 GMT Organization: Deja.com Message-ID: <93l6cr$pcq$1@nnrp1.deja.com> References: <93igkj$grt$1@lure.pipex.net> <3A5DC6D5.5A8446D8@hercii.mar.lmco.com> NNTP-Posting-Host: 205.232.38.14 X-Article-Creation-Date: Thu Jan 11 20:51:44 2001 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x58.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:3925 Date: 2001-01-11T20:51:44+00:00 List-Id: In article <3A5DC6D5.5A8446D8@hercii.mar.lmco.com>, Brian Courtney 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/