comp.lang.ada
 help / color / mirror / Atom feed
* Re: Finding out parameters which are not written
@ 1997-08-27  0:00 Robert Dewar
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Dewar @ 1997-08-27  0:00 UTC (permalink / raw)



>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 ??? >>


Using the standard version of GNAT with -Wuninitialized and -O2, we get

xxx.adb: In function `xxx':
xxx.adb:1: warning: `result' might be used uninitialized in this function

Not very localized, but better than not getting a warning at all!





^ permalink raw reply	[flat|nested] 8+ messages in thread
* Finding out parameters which are not written
@ 1997-08-12  0:00 Gerhard Radatz
  1997-08-12  0:00 ` Gerhard Radatz
  1997-08-12  0:00 ` Larry Kilgallen
  0 siblings, 2 replies; 8+ messages in thread
From: Gerhard Radatz @ 1997-08-12  0:00 UTC (permalink / raw)



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 ???




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1997-08-28  0:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-27  0:00 Finding out parameters which are not written Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-08-12  0:00 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
1997-08-17  0:00   ` Fergus Henderson
     [not found]   ` <5u180q$l69@mulga.cs.mu.OZ.AU>
1997-08-28  0:00     ` Stuart Palin

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