comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Type of subtraction operator
Date: Fri, 29 May 2009 08:24:10 -0700 (PDT)
Date: 2009-05-29T08:24:10-07:00	[thread overview]
Message-ID: <890d5a12-2a1d-4ee9-a443-324f5d60bfaf@n8g2000vbb.googlegroups.com> (raw)
In-Reply-To: utHTl.36790$d36.24148@bgtnsc04-news.ops.worldnet.att.net

On May 28, 7:09 pm, a...@anon.org (anon) wrote:
> Note: Also, using the two statements
>
>    Z : Integer := Natural ( X - Y ) ;  
>    pragma Suppress ( Range_Check, On => Z ) ;
>
> will will cause a CONSTRAINT_ERROR to occur at run time. But should it,
> since Range checking for Z has been suppressed.

Seems OK to me.  The Constraint_Error is raised by evaluating the
expression on the right-hand side of the := and thus really has
nothing to do with Z.  Anyway, as AI95-224 says, "there is no clear
definition (or agreement) on" the meaning of the On parameter of
Suppress, which is why it's now an obsolescent feature.  So while it's
possible for two people to have two (or more) interpretations of what
On=>Z means in this case, the language standard doesn't help decide
which one is right.  Furthermore, there's no requirement for Ada
implementations to actually obey Suppress pragmas; code that uses
Suppress must still expect that the exceptions may be raised anyway,
and the AARM says the pragma should be used for efficiency only.

                                         -- Adam



  reply	other threads:[~2009-05-29 15:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28 21:23 Type of subtraction operator Maciej Sobczak
2009-05-28 21:54 ` Adam Beneschan
2009-05-29  2:09 ` anon
2009-05-29 15:24   ` Adam Beneschan [this message]
2009-05-30  7:47     ` anon
replies disabled

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