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: Wed, 11 Jun 2008 07:58:44 -0700 (PDT) Organization: http://groups.google.com Message-ID: <55613982-679e-419d-8656-03b549393289@w4g2000prd.googlegroups.com> References: <0cbb6daf-01e9-40f5-855c-4f1d45cb0096@m73g2000hsh.googlegroups.com> <87abhs6qyj.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 1213196324 9252 127.0.0.1 (11 Jun 2008 14:58:44 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 11 Jun 2008 14:58:44 +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:651 Date: 2008-06-11T07:58:44-07:00 List-Id: 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? 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. -- Adam