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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ca9eef4d5e2078ea X-Google-Attributes: gid103376,public From: Alan E & Carmel J Brain Subject: Re: Beware: Rep spec on an enumeration type causes code explosion Date: 1997/12/14 Message-ID: <3494D286.23BE@dynamite.com.au>#1/1 X-Deja-AN: 298062233 Content-Transfer-Encoding: 7bit References: <66po35$1a1$1@gte2.gte.net> Mime-Version: 1.0 Reply-To: aebrain@dynamite.com.au Content-Type: text/plain; charset=us-ascii Organization: @home Newsgroups: comp.lang.ada Date: 1997-12-14T00:00:00+00:00 List-Id: Rakesh Malhotra wrote: > We work on safety critical projects. And if we have a safety critical > bit of code that defines and uses an enumeration then we use the rep > clause to provide more than 1 bit separation between adjacent values in > the enumeration. That way if 1 bit got corrupted the value could not > become some other legal value. See if I understand you correctly: Thus you'd use 2#1100 and 2#0011 for example, to avoid single-bit soft failures. Just don't choose 2#0000 and 2#1111 as many soft failures either latch high or latch low. Right? Interesting, not seen this technique used before, but it makes sense in some areas. And my vast ignorance is infinitesimally decreased, thank-you. Am I right in thinking that in the areas where such paranoia is reasonable, the code could well look like: SECTION_1 begin single statement, or at most a few exception when (etc) end SECTION_1; SECTION_2 begin single statement, etc exception when (etc) end SECTION_2; and repeat as nauseum. Such code, where efficiency is not a major consideration :) might well be appropriate in certain specialised areas. Just not in the general case, even for safety-critical stuff. -- aebrain@dynamite.com.au <> <> How doth the little Crocodile | Alan & Carmel Brain| xxxxx Improve his shining tail? | Canberra Australia | xxxxxHxHxxxxxx _MMMMMMMMM_MMMMMMMMM abrain@cs.adfa.oz.au o OO*O^^^^O*OO o oo oo oo oo By pulling MAERKLIN Wagons, in 1/220 Scale