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,c1131ea1fcd630a X-Google-Attributes: gid103376,public From: heatwole@erols.com (Kevin D. Heatwole) Subject: Re: To Initialise or not Date: 1996/05/04 Message-ID: #1/1 X-Deja-AN: 153023625 references: <318508FE.204B@sanders.lockheed.com> <318792E8.28CC1042@escmail.orl.mmc.com> <4masvn$1ai@linus.mitre.org> organization: Erols Internet Services newsgroups: comp.lang.ada Date: 1996-05-04T00:00:00+00:00 List-Id: In article , bobduff@world.std.com (Robert A Duff) wrote: > It *is* possible, however, to detect all uninitialized variables at run > time, and detect *some* of them at compile time. I just thought I'd point out that OC System's PowerAda product includes a tool to detect all uninitialized variables at runtime. We call the tool "afun" (Ada Find UNinitialized variables) which is based upon our Aprobe debugging/monitoring technology (which is unique amongst all the compiler vendors). Afun works at the machine level by "patching" all loads/stores to memory. As the program executes, it keeps track of which locations have been stored to and logs a call traceback whenever the program attempts to load from an uninitialized location. This technique can slow down a program a bit, but it can be very valuable at ferreting out a use of an uninitialized variable (in my experience, these bugs can be the hardest to weed out of an application since the use of an uninitialized variable may not show up during testing but wait until some inopportune time operationally). Anyway, afun isn't perfect since it can identify locations that were initialized as being uninitialized (e.g., the memory location is shared with another process and the other process initialized the location), and it can take some expertize to use. However, it is generally worth the effort if you want to minimize the defects in your applications. I just thought I'd point this out, since some problems (like uninitialized variables) are best solved by good tools (even if the programming language generally helps to avoid the problem). Kevin Heatwole OC Systems, Inc.