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!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 11 Jun 2008 20:16:54 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Enumeration representation clause surprise. References: <48502e38$0$23821$4f793bc4@news.tdc.fi> X-Newsreader: Tom's custom newsreader Message-ID: <88GdnYlGypeb5M3VnZ2dnUVZ_hzinZ2d@comcast.com> Date: Wed, 11 Jun 2008 20:16:54 -0500 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 71.202.183.17 X-Trace: sv3-SzbB+SsApmr32xnEiMwKOviZaHHUNZLHDKQDb18lrILf6s4UBzuAD9KPRUKz+33pZq7+sLQhn3W9hEk!bhjuTjeqRWFNB2FMcnbD1F/LyFaCIqXmXew1NVi9vGljqJZ2suQP4r61HD3gRzB/g0mnp0C0/QsZ!trmjf0RxEjAEzGpraffVLIDQt3tgaQ== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Xref: g2news1.google.com comp.lang.ada:660 Date: 2008-06-11T20:16:54-05:00 List-Id: >There's a "Note" in RM13.4(11/1) that says "Unchecked_Conversion >may be used to query the internal codes used for an enumeration type". That, along with 13.4(7) "An enumeration representation clause specifies the coding aspect of representation. The coding consists of the internal code for each enumeration literal, ..." sure sounds to me like an Unchecked_Conversion should return the internal code set by the enumeration representation clause, ie, the number 1 or number 2 in this case. The fact the variable in question is in a record shouldn't make that false. RM 13.1(1) says about representation items (a superset of representation clauses) that "They can be provided to ... or to interface with features that are outside the domain of the language (for example, peripheral hardware)." In this case that clearly would not work. And if the compiler is going to ignore something the programmer asked for, it ought to at least generate a warning.