comp.lang.ada
 help / color / mirror / Atom feed
From: slinky.cs.nyu.edu!slinky.cs.nyu.edu!nobody@nyu.edu  (Robert Dewar)
Subject: Re: Unchecked_Conversion question
Date: 2 Sep 93 03:00:25 GMT	[thread overview]
Message-ID: <263nk9$msm@schonberg.cs.nyu.edu> (raw)

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!

             reply	other threads:[~1993-09-02  3:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-02  3:00 Robert Dewar [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-09-04  0:13 Unchecked_Conversion question Robert Dewar
1993-09-03 21:55 Robert Parkhill
1993-09-03 20:14 Wes Groleau x1240 C73-8
1993-09-03 19:51 dog.ee.lbl.gov!agate!howland.reston.ans.net!spool.mu.edu!sdd.hp.com!netwo
1993-09-03 19:06 dog.ee.lbl.gov!agate!spool.mu.edu!umn.edu!email.sp.paramax.com!not-for-ma
1993-09-02 15:43 dog.ee.lbl.gov!overload.lbl.gov!agate!howland.reston.ans.net!noc.near.net
1993-09-02 13:38 Lowell S. VonRuden x5294
1993-09-01 16:43 dog.ee.lbl.gov!network.ucsd.edu!news.cerf.net!shrike.irvine.com!adam
1993-09-01 15:47 Lowell S. VonRuden x5294
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox