comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter Hend�n" <phenden@tdab.com>
Subject: Re: When to do a constraint check and not ??
Date: Fri, 26 Oct 2001 12:01:19 GMT
Date: 2001-10-26T12:01:19+00:00	[thread overview]
Message-ID: <jgcC7.2435$R43.420484@newsb.telia.net> (raw)
In-Reply-To: 3BD91EF8.EEB7EDBA@systems.saab.se

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

"Per Sandberg" wrote:
> procedue bla is
> b : boolean; --< B may contain any bit pattern at this point.

> procedure test( p : in out boolean ) is
> begin
> b := false;
> end test;

> begin
> test(b); --<< Is the compiler allowed to insert a constraint check on b
> here ??
> end;

> Is the answer that it is up to the wendor.
> I did not get any clues from the LRM.

The main clues are in 3.3.1, 13.9.1 and H.1 of ARM. There are some
comments in the same sections of the AARM.

My interpretation: The compiler is allowed, but not required, to raise
Constraint_Error or Program_Error exactly at (before) the call to test
in your example.

I'd be happy to hear from anyone more knowledgable than me on this,
even if my Coding Rules would still be to require initialization of all
objects at the earliest possible place, ie. normally at declaration.

Regards,
Peter Hend�n

--
Peter Hend�n           http://www.algonet.se/~phenden
ICQ: 14672398
Teknisk Dokumentation AB          http://www.tdab.com






  reply	other threads:[~2001-10-26 12:01 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 [this message]
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
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