comp.lang.ada
 help / color / mirror / Atom feed
From: kilgallen@eisner.decus.org (Larry Kilgallen)
Subject: Re: Finding out parameters which are not written
Date: 1997/08/12
Date: 1997-08-12T00:00:00+00:00	[thread overview]
Message-ID: <1997Aug12.070728.1@eisner> (raw)
In-Reply-To: 33F02867.322D@aut.alcatel.at


In article <33F02867.322D@aut.alcatel.at>, Gerhard Radatz <gerhard.radatz@aut.alcatel.at> writes:
> Does anyone know about a tool which can detect such situations as the
> following:
> 
> 	procedure xxx (result: out INTEGER) is
>         begin
> 	     if <<condition>> then
> 	         result := 0;
>              end if;
>         end;
> 
> Obviously, this proc is erroneous and result will not be written if
> <<condition>> is FALSE.
> However, my Ada-Compiler (DEC-ADA for VMS) does not detect this problem,
> because result is written "at least once" in the body of xxx.
> 
> Is there any tool which can provide help ???

Such a tool could not handle the case where <<condition>> depended on
some input determined outside the scope of the current compilation. A
static analysis that only works for the simple cases would seem to be
unattractive since those are precisely the cases where humans can best
spot the error.

Consider a long series of conditional tests each depending on different
arcane input.  If no condition results in setting the output, it would
seem that cannot be determined at compile time.  Run time detection is
a different matter, of course.

Larry Kilgallen




  parent reply	other threads:[~1997-08-12  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-12  0:00 Finding out parameters which are not written Gerhard Radatz
1997-08-12  0:00 ` Gerhard Radatz
1997-08-12  0:00   ` Robert A Duff
1997-08-12  0:00     ` Matthew Heaney
1997-08-12  0:00 ` Larry Kilgallen [this message]
1997-08-17  0:00   ` Fergus Henderson
     [not found]   ` <5u180q$l69@mulga.cs.mu.OZ.AU>
1997-08-28  0:00     ` Stuart Palin
  -- strict thread matches above, loose matches on Subject: below --
1997-08-27  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