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!news1.google.com!postnews.google.com!f36g2000hsa.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Enumeration representation clause surprise. Date: Thu, 12 Jun 2008 15:42:29 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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 1213310549 9404 127.0.0.1 (12 Jun 2008 22:42:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 12 Jun 2008 22:42:29 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f36g2000hsa.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:681 Date: 2008-06-12T15:42:29-07:00 List-Id: On Jun 12, 2:26 pm, Samuel Tardieu wrote: > > Interesting. I had been playing with a similar example, and have > > modified it a bit to present. What got me is the record type with > > length 1 but an object with that type that was length zero! > > The only possible value for X_Type is X. This requires 0 bit of > information to represent this fact. > > > (It compiles without any warnings). > > With the proposed patch, it gives: > > GNAT 4.4.0 20080611 (experimental) > Copyright 1992-2008, Free Software Foundation, Inc. > > Compiling: test1.adb (source file time stamp: 2008-06-12 21:22:24) > > 26. X1 at 0 range 0 .. -1; -- Minus 1 !! > | > >>> warning: component representation will be biased So what would the value of the bias be? -- Adam