comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Need help with DEC Ada
Date: 20 Jan 1995 00:22:54 -0500
Date: 1995-01-20T00:22:54-05:00	[thread overview]
Message-ID: <3fnhbe$4lq@gnat.cs.nyu.edu> (raw)
In-Reply-To: Mats.Weber-1801951923090001@mlma11.matrix.ch

Mats says:

"the original (2**31)-1 should not cause any problem. Ae you really sure it
generates a warning ?"

sorry Mats, that is wrong, in Ada 83, this expression was not a static
expression evaluated at compile time, and hence a compiler is allowed to
compute it at runtime, insisting that all intermediate values are in 
range of the type (in this case a 32 bit integer).

So Dec Ada is perfectly correct (just not very friendly) in raising CE
in this situation.

Whatever model you have that says that this should not cause any problem
is flawed with respect to Ada 83. However, as I pointed out in a previous
message, Ada 95 has "fixed" this "problem" by requiring static expressions
to be evaluated exactly, even when they appear as subexpressions of non
static exprssions, or in contexts not requiring static expressions.




  reply	other threads:[~1995-01-20  5:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-01-17 21:01 Need help with DEC Ada Phil Dennis
1995-01-18 18:23 ` Mats Weber
1995-01-20  5:22   ` Robert Dewar [this message]
1995-01-23 16:22     ` Mats Weber
1995-01-19 19:38 ` Robert I. Eachus
replies disabled

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