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,803df5f3f60558d5 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Uninitialized "out" parameters Date: 1996/07/20 Message-ID: #1/1 X-Deja-AN: 170151786 references: <31EEACDA.64880EEB@sage.inel.gov> <4sq614$kai@mulga.cs.mu.OZ.AU> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-07-20T00:00:00+00:00 List-Id: Fergus said "No, certainly it is possible. There are languages in which any code that might attempt to use an uninitialized variable is a compile-time error. It would certainly be possible for an Ada compiler to give warnings in all cases where a variable might be used before it was initialized." Well it depends what you mean. If we read what you say literally, it is obviously incorrect, since it requires the halting problem to be solved: procedure x is m,n : integer; begin (big chunk of code not referencing m,n) m := n; end; this code references the uninitialized variable n if and only if the big chunk of code halts. That's an easy proof. If you don't mind getting bogus warnings, i.e. warnings that might be false, then your statement is trivially true, just post a warning on every use (of course your compiler might be more clever than this, but this is again a simple proof.