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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c9f437cff8842e X-Google-Attributes: gid103376,public From: Bryce Bardin Subject: Re: Enumeration representation Date: 1999/09/12 Message-ID: <37DB15A2.2CF36CC8@home.com>#1/1 X-Deja-AN: 523962283 Content-Transfer-Encoding: 7bit References: <37D8E3BC.175DB72C@newtech.it> <7rcceh$anh$1@nnrp1.deja.com> X-Accept-Language: en,en-GB,en-US,fr,fr-BE,fr-CA,fr-FR,fr-CH,de,de-AT,de-DE,de-CH,it,es,es-AR,es-CO,es-MX,es-ES Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@home.net X-Trace: news.rdc2.occa.home.com 937104802 24.7.50.190 (Sat, 11 Sep 1999 19:53:22 PDT) Organization: @Home Network MIME-Version: 1.0 NNTP-Posting-Date: Sat, 11 Sep 1999 19:53:22 PDT Newsgroups: comp.lang.ada Date: 1999-09-12T00:00:00+00:00 List-Id: Keith Thompson wrote: > > Robert Dewar writes: > > In article , > > Keith Thompson wrote: > > If you try to read > > > such a value from an external interface, it's very difficult > > > to check that you've gotten a valid value without invoking > > > erroneous execution (undefined behavior). > > > > No, it is quite easy, do an unchecked conversion of the value > > into the enumeration variable, or just read the value in > > directly with appropriate low level I/O, then do a 'Valid test. > > > > And Keith, before you go rummaging around legalise in the RM, > > be sure to read the relevant AI, whose purpose is basically > > to say, yes of course the above works, whatever the RM says :-) > > Ok, I think you're right. > > As I recall, a strict reading of the RM implies that the above obvious > approach invokes erroneous execution, though a conforming > implementation would have to be somewhat perverse to make it do > anything other than the obvious. (I think you could avoid > erroneousness by wraping the enumeration variable in a record.) Given > the AI (whose status I haven't followed lately), such an > implementation would have to be both perverse and non-conforming -- > hopefully an unlikely combination. > > Do you happen to remember the AI number? I'm pretty sure it was based > on a comment I submitted. AI95-00167/01, which is proposed to be a binding interpretation, but is not yet written up in final form nor approved by either the ARG or WG9, as far as I know. Bryce Bardin