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 Newsgroups: comp.lang.ada Subject: Re: Enumeration representation clause surprise. References: <0cbb6daf-01e9-40f5-855c-4f1d45cb0096@m73g2000hsh.googlegroups.com> <87abhs6qyj.fsf@willow.rfc1149.net> <55613982-679e-419d-8656-03b549393289@w4g2000prd.googlegroups.com> From: Samuel Tardieu Date: Wed, 11 Jun 2008 17:56:12 +0200 Message-ID: <871w346k4j.fsf@willow.rfc1149.net> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:6NzHmV3K7A2oNDatAeBNJeIL4BY= 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: 11 Jun 2008 18:00:01 MEST NNTP-Posting-Host: 88.191.14.223 X-Trace: 1213200001 news-3.free.fr 15492 88.191.14.223:57235 X-Complaints-To: abuse@proxad.net Path: g2news1.google.com!news1.google.com!news.glorb.com!news.ecp.fr!feed.ac-versailles.fr!proxad.net!feeder1-2.proxad.net!cleanfeed2-a.proxad.net!nnrp4-2.free.fr!not-for-mail Xref: g2news1.google.com comp.lang.ada:654 Date: 2008-06-11T18:00:01+02:00 List-Id: Adam> This seems odd to me. Having GNAT select a biased component in Adam> Christoph's example makes some sense, since a compiler can choose any Adam> representation it likes. But in Markus' case, he specifically asked Adam> for a certain representation for the enumeration types---should GNAT Adam> take it upon itself to change that, and display a warning that doesn't Adam> make it clear that it's disrespecting his request to have the Adam> enumeration represented a certain way? Adam> Adam> I dunno... maybe this would be acceptable to some, and apparently Adam> Markus thinks it's OK, but ... it's just not what I would expect ... Adam> I guess it's a subjective thing. I would prefer an error indeed, but I can't seem to find a clause in chapter 13 which says that in records with representation clauses the representation given for objects when created independently the enumeration representation clause must be honored. Anyway, the patch I submitted will probably be evaluated by AdaCore language lawyers. If an error must be signalled, then the warning will be transformed into one. Sam