comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Constraint checking of actuals passed to Attributes
Date: 2000/05/08
Date: 2000-05-08T19:54:18+00:00	[thread overview]
Message-ID: <39171B69.2F983487@averstar.com> (raw)
In-Reply-To: 391250A8.99D1585C@hotmail.com

Matt Brennan wrote:
> 
> Quick question:
> 
> Is an implementation required to generate code to check that an actual
> parameter passed to an attribute (for example, 'Image of a scalar type)
> is subtype conformant with the formal parameter?

Most attribute functions like 'Image, 'Pos, etc., have the base subtype
as the parameter subtype, meaning that no constraints apply.
Hence, the only possible problem occurs if the actual parameter is
not a value of the *type* which could happen due to unchecked
conversion, (unchecked) binary input, or an uninitialized variable.

Implementations are not required to deal nicely with the unchecked
conversion or binary input situation, but are required to at least
"survive" the uninitialized variable situation in Ada 95.
This is because the first two are "erroneous" situations whereas
the last one is merely a "bounded error."  This means that in the
first two cases, anything could happen (incineration of disk drive,
etc.), whereas in the uninitialized case, Program_Error, Constraint_Error,
or producing some arbitrary value as the result would be acceptable.

In Ada 83, using uninitialized variables is erroneous as well,
so some compilers out there might still misbehave on them due
to bugs or ancestry. 

> Opinions with ARM references most welcome! :-)

RM95 A.13(17) -- unchecked binary input
RM95 13.9(11)/13.9.1(8) -- unchecked conversion/abnormality
RM95 13.9.1(9-11) -- uninitialized variable bounded error

> 
>   Matt

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Commercial Division, AverStar (formerly Intermetrics)
(http://www.averstar.com/services/IT_consulting.html)  Burlington, MA  USA




  parent reply	other threads:[~2000-05-08  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-05  0:00 Constraint checking of actuals passed to Attributes Matt Brennan
2000-05-05  0:00 ` Keith Thompson
2000-05-08  0:00 ` Tucker Taft [this message]
2000-05-09  0:00   ` Robert Dewar
2000-05-09  0:00     ` Ted Dennison
2000-05-09  0:00       ` Robert Dewar
2000-05-09  0:00         ` Ted Dennison
2000-05-09  0:00           ` Robert Dewar
2000-05-09  0:00             ` Ted Dennison
2000-05-09  0:00               ` Robert A Duff
2000-05-09  0:00     ` Robert A Duff
2000-05-09  0:00       ` Robert Dewar
2000-05-09  0:00         ` Robert A Duff
2000-05-09  0:00           ` Keith Thompson
2000-05-10  0:00             ` Robert A Duff
2000-05-14  0:00               ` Simon Wright
2000-05-17  0:00                 ` Robert A Duff
2000-05-12  0:00             ` Tucker Taft
2000-05-12  0:00               ` Ted Dennison
2000-05-12  0:00                 ` Robert A Duff
2000-05-12  0:00                   ` Ted Dennison
2000-05-16  0:00                     ` Robert A Duff
2000-05-16  0:00                       ` Ted Dennison
2000-05-17  0:00                       ` Robert Dewar
2000-05-10  0:00           ` Robert Dewar
2000-05-10  0:00             ` Robert A Duff
2000-05-15  0:00             ` Bill Greene
2000-05-10  0:00           ` David C. Hoos, Sr.
2000-05-22  0:00           ` Kenneth Almquist
2000-05-10  0:00   ` Matt Brennan
replies disabled

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