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=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 2 Sep 93 03:00:25 GMT From: slinky.cs.nyu.edu!slinky.cs.nyu.edu!nobody@nyu.edu (Robert Dewar) Subject: Re: Unchecked_Conversion question Message-ID: <263nk9$msm@schonberg.cs.nyu.edu> List-Id: You cannot rely on unchecked conversion not raising a constraint error if the value is out of range. In fact you cannot rely on the compiler not generating code to erase your system disk if the value is out of range, since the program execution is erroneous at that point! It is in fact possible to construct an example where it is not beyond the bounds of belief that an optimizing compiler WOULD do something drastic like wipeout your system disk if your program was erroneous in this way. 9X tries where possible to limit the effects of erroneousness of this type, but in Ada 83, there are no such limitations. That being said, I think that in practice you will find this code to be fairly portable. Just isolate this use of unchecked conversion with clear comments as to what you are expecting from the compiler. One should never be to worried by writing code at this level when that is what is needed!