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,6339fea48a1b8cda X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!w4g2000prd.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Enumeration representation clause surprise. Date: Fri, 13 Jun 2008 09:21:02 -0700 (PDT) Organization: http://groups.google.com Message-ID: <4f5f512a-36e6-466e-a5a9-5f26857841f8@w4g2000prd.googlegroups.com> References: <770ae1af-b9fd-4c8a-915c-a5cb3ea8fc81@c65g2000hsa.googlegroups.com> <87hcbybazk.fsf@willow.rfc1149.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1213374062 25830 127.0.0.1 (13 Jun 2008 16:21:02 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 13 Jun 2008 16:21:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w4g2000prd.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:698 Date: 2008-06-13T09:21:02-07:00 List-Id: On Jun 13, 1:27 am, christoph.gr...@eurocopter.com wrote: > > > With the proposed patch, it gives: > > > > GNAT 4.4.0 20080611 (experimental) > > > 26. X1 at 0 range 0 .. -1; -- Minus 1 !! > > > | > > > >>> warning: component representation will be biased > > > So what would the value of the bias be? > > type X_Type is ( X ); > for x_type use (x => 16#7FFF_FFFF#); > > 16#7FFF_FFFF# of course > > Since this is the only value, nothing need be stored to know which > value it is. This is like a constant in ROM, I gather. My point is that the "bias" is the difference between the (conceptual) value being represented, and the number actually stored in memory. So what number is stored in a 0-bit data item? I suppose you could arbitrarily decide it's zero (which would make some sense mathematically) but it seems more commonsensical to say that nothing is stored there because there ain't no bits to store anything in. -- Adam