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, MSGID_RANDY 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: Robert Dewar Subject: Re: Enumeration representation Date: 1999/09/11 Message-ID: <7rcceh$anh$1@nnrp1.deja.com>#1/1 X-Deja-AN: 523593238 References: <37D8E3BC.175DB72C@newtech.it> X-Http-Proxy: 1.0 x43.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Sat Sep 11 01:49:08 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-09-11T00:00:00+00:00 List-Id: 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 :-) Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.