comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com (Robert Dewar)
Subject: Re: When to do a constraint check and not ??
Date: 1 Nov 2001 19:44:10 -0800
Date: 2001-11-02T03:44:10+00:00	[thread overview]
Message-ID: <5ee5b646.0111011944.7905d0b3@posting.google.com> (raw)
In-Reply-To: 3BE18C46.1AB713B4@avercom.net

Tucker Taft <stt@avercom.net> wrote in message news:<3BE18C46.1AB713B4@avercom.net>...
> Certainly
> all compilers will want to believe that "in" and "in out"
> parameters are in range, so the (implicit) assignment
> from b to the formal parameter p when the function is
> called will need to ensure the value is in range.
> If it happens to have "stack junk" in it which puts it
> outside the typical 0..1 range used for booleans, then
> you will get a constraint_error raised here.

This is incorrect, it simply describes one possible implementation of
the RM rules, there is no specific requirement in the RM that the
range check be performed here. Different compilers may (and do) take
different
viewpoints on when to insert validity checks (to meet
the RM requirement that invalid data not cause erroneous
execution in most cases).
 
In GNAT Pro, a new switch -gnatV allows detailed control over when
validity checks occur, and can be used to force
validity checks in many situations where they are not required. We
have found this to be a useful debugging aid.



  reply	other threads:[~2001-11-02  3:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-26  8:29 When to do a constraint check and not ?? Per Sandberg
2001-10-26 12:01 ` Peter Hend�n
2001-10-26 13:57 ` DuckE
2001-10-26 14:18 ` Ted Dennison
2001-10-26 23:44 ` Jeffrey Carter
2001-11-01 17:54 ` Tucker Taft
2001-11-02  3:44   ` Robert Dewar [this message]
2001-11-05 10:02 ` Peter Amey
replies disabled

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