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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c70ca467407e48a3,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-12 06:25:07 PST Path: nntp.gmd.de!Germany.EU.net!howland.reston.ans.net!gatech!udel!news.intercon.com!panix!cmcl2!lab.ultra.nyu.edu!kenner From: kenner@lab.ultra.nyu.edu (Richard Kenner) Newsgroups: comp.lang.ada Subject: Re: uninitialzed variables Date: 12 Jan 1995 14:25:07 GMT Organization: New York University Ultracomputer Research Lab Message-ID: <3f3e43$606@cmcl2.NYU.EDU> References: <3etund$hnr@miranda.gmrc.gecm.com> <3f0n6b$qnp@theopolis.orl.mmc.com> <3f3cq3$4tu@gnat.cs.nyu.edu> NNTP-Posting-Host: lab.ultra.nyu.edu Date: 1995-01-12T14:25:07+00:00 List-Id: In article <3f3cq3$4tu@gnat.cs.nyu.edu> dewar@cs.nyu.edu (Robert Dewar) writes: >T.E.D. says that all Ada compilers he knows detect uninitialized variables. >Well not quite, since this problem is of course recursively undecidable. It >is true that a compiler can detect some obvious cases of uninitialized >variables, that's not in GNAT yet, but is on our list of nice things to add. Actually, it is in GNAT since this is done by the GCC optimizer. Specify the flag -Wuninitialized along with -O or -O2 and it will warn about variables that appear to be uninitialized. As Robert points out, this must be approximate since the problem is undecidable. In practice, it tends to have more false positives than false negatives.