From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3f280e3f1e97f305 X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: Finding out parameters which are not written Date: 1997/08/12 Message-ID: <1997Aug12.070728.1@eisner>#1/1 X-Deja-AN: 263775952 X-Nntp-Posting-Host: eisner.decus.org References: <33F02867.322D@aut.alcatel.at> X-Trace: news.decus.org 871384051 2576 KILGALLEN [192.67.173.2] Organization: LJK Software Newsgroups: comp.lang.ada Date: 1997-08-12T00:00:00+00:00 List-Id: In article <33F02867.322D@aut.alcatel.at>, Gerhard Radatz writes: > Does anyone know about a tool which can detect such situations as the > following: > > procedure xxx (result: out INTEGER) is > begin > if <> then > result := 0; > end if; > end; > > Obviously, this proc is erroneous and result will not be written if > <> 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 <> 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