From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 2 Sep 91 23:48:52 GMT From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!wupost!waikato.ac.nz!pdenize @ucbvax.Berkeley.EDU Subject: Vax Ada - Runtime Crashes Message-ID: <1991Sep3.114852.4814@waikato.ac.nz> List-Id: with Standard_Disclaimer; My name is Paul Denize, until last year I was an Ada Programmer for the Royal New Zealand Navy. Since then I have been appointed a lecturer in computer science at the University of Waikato. I have upon arrival picked up on Vax Ada version 1.5 and discovered that the language behaves slightly differently to what I have been used to. In the Navy I was using ALSYS Ada and unless I found a comiler flaw which the company generally acknowledged then fixed your program NEVER crashed without generating an Ada Exception. I had got quite used to this methodology. However I toyed with Vax Ada and managed a number of crashes within an hour which I would have expected a CONSTRAINT_ERROR for. I defined an enumerated type say traffic_light_colour = (Red, Amber, Green); Then I produced a generic bit operator called NOT and negated a variable of typ e traffic_light_colour. Now Not Amber = Green, and Not Green = Amber, but Not Red resulted in a runtime death with no Ada Exception. Should I have expected this ? If I use unsafe methods to assign values how can I later check that the value is within the bounds without causing a runtime failure. It seems the compiler generates assumptions about the bounds of a variable that under some instances may not be true. I have no problem with this I was the idiot that created the unsafe conversion/assignment I should ensure the value(s) are safe. HOW ? Even more to the point what if its a record, Do I have to check every field ? PEEEEUUUUUKKKKKEEEE ! Paul Denize. ------------------------------------------------------------------------------- - Everyone agrees that the Modula-2 language has one ommision, no-one agrees - - what the ommission is. - -------------------------------------------------------------------------------