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: 3 Sep 93 20:14:16 GMT From: news.crd.ge.com!e7sa!groleau@uunet.uu.net (Wes Groleau x1240 C73-8) Subject: Re: Unchecked_Conversion question Message-ID: List-Id: In article <1993Sep1.154715.10498@Rapnet.Sanders.Lockheed.Com> lvonrude@Rapnet. Sanders.Lockheed.Com (Lowell S. VonRuden x5294) writes: > I am doing something that seems to work using a Verdix compiler, but I > have not been able to determine if this is something that will be safely > transportable. Hopefully, someone here can tell me. > [unchecked conversion does not raise constraint_error, but type conversion > does.] LRM requires type conversions to do constraint checks. This could understandably (IMHO) be skipped if the compiler could be certain that the check is guaranteed to pass. Obviously, there is no such guarantee for the output of an unchecked conversion. If you are using the type conversion to force the constraint check, I would say that putting both conversions together would guarantee that a compliant compiler would do the check at one point or another. If you'd like me to try it on VAX Ada, Janus (PC) Ada, Telesoft, or GNAT, send me enough source code... A warning about unchecked conversion with Verdix. We have demonstrated in at least one case on my current project that an out-of-range value did NOT raise constraint error when it was assigned to an object. Although we contended that LRM 5.2(3) required the constraint check, Verdix claimed that since the value came from an unchecked conversion (if you traced the logic back to a separately compiled subprogram) LRM 13.10.2(3) says no check is required. Wes Groleau