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!news4.google.com!feeder.news-service.com!news.albasani.net!news.ecp.fr!club-internet.fr!feedme-small.clubint.net!proxad.net!feeder1-1.proxad.net!cleanfeed1-a.proxad.net!nnrp2-2.free.fr!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Enumeration representation clause surprise. References: <770ae1af-b9fd-4c8a-915c-a5cb3ea8fc81@c65g2000hsa.googlegroups.com> From: Samuel Tardieu Date: Thu, 12 Jun 2008 23:26:55 +0200 Message-ID: <87hcbybazk.fsf@willow.rfc1149.net> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:nqar4PzJCY77aTvZLlMwHke037M= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Leafnode-NNTP-Posting-Host: 81.56.47.149 Organization: Guest of ProXad - France NNTP-Posting-Date: 12 Jun 2008 23:30:01 MEST NNTP-Posting-Host: 88.191.14.223 X-Trace: 1213306201 news-4.free.fr 22323 88.191.14.223:57848 X-Complaints-To: abuse@proxad.net Xref: g2news1.google.com comp.lang.ada:680 Date: 2008-06-12T23:30:01+02:00 List-Id: > 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 42 lines: No errors, 1 warning