From: "Samuel A. Mize" <smize@magellan.bgm.link.com>
Subject: Re: Why no constraint error?
Date: 1997/03/24
Date: 1997-03-24T00:00:00+00:00 [thread overview]
Message-ID: <33369ACC.41C6@magellan.bgm.link.com> (raw)
In-Reply-To: E7G5q1.J8q.0.-s@inmet.camb.inmet.com
Tucker Taft wrote:
> Well Bob, I believe GNAT is technically right in this one, though
> I think it may be pessimizing the code overall if it follows
> the approach implied by the above (see below for more discussion).
Sorry -- "pessimizing?" Could you supply a definition for the
less experienced? Do you mean "making less efficient through
excessive pessimism?" Thanks.
> One thing to keep in mind is that "out of the box" GNAT suppresses
> certain run-time checks (not my favorite feature of GNAT, I might say ;-).
> I trust this was compiled with all checks *on*...
It was.
> In this particular case, the propagation of an uninitialized
> value from one variable to another is relatively benign, since
> no memory is being trashed by this propagation. The real question
> is what happens when "Target" is used as an index into an array.
> Does GNAT remember that Target might become deinitialized by the
> assignment, and hence do the check when Target is used as an index?
No.
> Or does GNAT see that Target is initialized to a valid value, and
> presume that it never becomes deinitialized.
No. I tested the array case with a straight uninitialized
variable, and it indexed to it. (I used Normalize_Scalars
to get a predictable value, but I don't *think* this would
impact the presence/absence of this range check.)
> In our AdaMagic front end, objects are identified by the compiler
> as either "reliable" or "unreliable." ...
This sounds slick. I'll look at your web site.
> I'm curious what approach GNAT adopts, and whether the above
> would in fact reveal a bug if Target were used as an array index...
No, it doesn't.
>
> -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/
> Intermetrics, Inc. Burlington, MA USA
Sam Mize
(same Sam Mize, different account -- opinions are my own)
--
Samuel Mize (817) 619-8622 "Team Ada"
Hughes Training Inc. PO Box 6171 m/s 400, Arlington TX 76005
next prev parent reply other threads:[~1997-03-24 0:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-03-20 0:00 Why no constraint error? Samuel Mize
1997-03-20 0:00 ` Samuel Mize
1997-03-21 0:00 ` Robert A Duff
1997-03-22 0:00 ` Robert Dewar
1997-03-22 0:00 ` Robert A Duff
1997-03-22 0:00 ` Tucker Taft
1997-03-22 0:00 ` Robert A Duff
1997-03-24 0:00 ` Tucker Taft
1997-03-24 0:00 ` Samuel A. Mize [this message]
1997-03-24 0:00 ` Robert A Duff
1997-03-24 0:00 ` Robert Dewar
1997-03-24 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox