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!feeder1.cambrium.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng1.kpn.DE!nntp.ilk.net!not-for-mail From: Markus Schoepflin Newsgroups: comp.lang.ada Subject: Re: Enumeration representation clause surprise. Date: Wed, 11 Jun 2008 17:23:25 +0200 Organization: Customer of ILK Internet GmbH, Karlsruhe, Germany Message-ID: References: <0cbb6daf-01e9-40f5-855c-4f1d45cb0096@m73g2000hsh.googlegroups.com> <87abhs6qyj.fsf@willow.rfc1149.net> <55613982-679e-419d-8656-03b549393289@w4g2000prd.googlegroups.com> NNTP-Posting-Host: csdc.comsoft.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nntp.ilk.net 1213197805 27314 212.86.205.70 (11 Jun 2008 15:23:25 GMT) X-Complaints-To: usenet@ilk.net NNTP-Posting-Date: Wed, 11 Jun 2008 15:23:25 +0000 (UTC) User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) In-Reply-To: <55613982-679e-419d-8656-03b549393289@w4g2000prd.googlegroups.com> Xref: g2news1.google.com comp.lang.ada:653 Date: 2008-06-11T17:23:25+02:00 List-Id: Adam Beneschan wrote: > On Jun 11, 6:28 am, Samuel Tardieu wrote: >> Markus> This is exactly my point. I would have expected a compile time error >> Markus> for this impossible request. >> >> Markus> Representation clauses are (amongst other) meant to specify specific >> Markus> binary layouts for interfacing with the external world. Or am I >> Markus> mistaken here? >> >> I can't find anything in RM chapter 13 which either forbids or allows >> such a behaviour. I will submit a patch for GNAT which gives a new >> warning for this case: >> >> 11. A1 at 0 range 0 .. 0; -- (*) >> | >> >>> warning: component representation will be biased > > This seems odd to me. Having GNAT select a biased component in > Christoph's example makes some sense, since a compiler can choose any > representation it likes. But in Markus' case, he specifically asked > for a certain representation for the enumeration types---should GNAT > take it upon itself to change that, and display a warning that doesn't > make it clear that it's disrespecting his request to have the > enumeration represented a certain way? Do you suggest to reword the warning? Or give an error instead? > > I dunno... maybe this would be acceptable to some, and apparently > Markus thinks it's OK, but ... it's just not what I would expect ... > I guess it's a subjective thing. Actually I'm OK with anything that gives me a way to detect this, be it warning, error, or whatever. Markus