[comp.lang.ada] forwarded mail

MEANS@MACOMW.ARPA (Bob Means) (06/10/87)

Date: Wed May 27 14:20:56 1987
Version: VM version 2.27 -SNUFFL-
From: John Bollenbacher TPII 120 x2220 <JBOLLENBACHE@SNUFFL>
To: means@TORREY
Subject: Ada bulletin board

Bob,

Do you think you could post this mail on the Arpanet Ada BB for me?  Thanks.

===================

	Dale Worley at Cullinet Software writes: 
	
	
 Is the following program required to raise CONSTRAINT_ERROR (or
whatever)? 	
 	
 procedure y is 	
   type x is range 0..100; 	
   a : x := 100; 	
 begin 	
   a := a + 1;     	
 end y; 	   

  I think the answer lies in LRM 11.6(5):
   "A predefined operation need not be invoked at all if its only possible
    effect is to propogate a predefined exception..."

  Since the only other possible effect of this program is to set the value
of 'a' (which is then never used), the compiler can optimize the whole program
away.  Moral: beware of making conclusions about exceptions based on simple
programs.

-John Bollenbacher (M/A-COM Government Systems)

-------
-------

-------