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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f924a751f0e5a4b3,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g43g2000cwa.googlegroups.com!not-for-mail From: jeff@thecreems.com Newsgroups: comp.lang.ada Subject: Ada83/95 Compatibility Date: 13 Dec 2005 10:46:23 -0800 Organization: http://groups.google.com Message-ID: <1134499582.913837.213460@g43g2000cwa.googlegroups.com> NNTP-Posting-Host: 70.197.192.194 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1134499588 18976 127.0.0.1 (13 Dec 2005 18:46:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 13 Dec 2005 18:46:28 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g43g2000cwa.googlegroups.com; posting-host=70.197.192.194; posting-account=o1Y7HQ0AAAB5Vy7A_brrP41bqxJ6lZBd Xref: g2news1.google.com comp.lang.ada:6870 Date: 2005-12-13T10:46:23-08:00 List-Id: I am porting a large batch of Legacy Ada 83 code to an Ada 95 compiler. One issue i have hit has to do with the 'size of subtypes. (not that much of a surprise) I was well aware that there were some differences to be expected in this area (e.g. natural'size being 31) but one thing that surprised me is with this particular compiler, even object sizes ended up being impacted. For example type My_Big_Int is range -2**31 .. 2**31 -1 ; for My_Big_Int'size use 32; subtype little_range is My_Big_Int range 0 .. 255; A : My_Big_Int; B : Little_Range; I was not surprised that Little_Range'size = 8 What surprised me was that b'size comes back as 8. I've re-read the representation chapter again and I think the compiler is probably within its rights to do this. Since one can't specify a 'size on a subtype like this it appears that there really is no way to specify a minimum size for a subtype. While I obviously with B'size = 32 I am not 100% sure that I understand the chapter well enough to convince myself that it really is a legal outcome. ..Also note this is not GNAT (which appears to act as I'd expect for targets I have access to).