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: mfeldman@seas.gwu.edu (Michael Feldman) Subject: Re: Uninitialized "out" parameters Date: 1996/07/20 Message-ID: <4ss763$2aq@felix.seas.gwu.edu>#1/1 X-Deja-AN: 169262111 references: <4smh9i$gp5@krusty.irvine.com> <4smmhe$9cs@goanna.cs.rmit.edu.au> <4smo24$h25@krusty.irvine.com> <31EF9DFC.6FB4@csehp3.mdc.com> organization: George Washington University newsgroups: comp.lang.ada Date: 1996-07-20T00:00:00+00:00 List-Id: In article <31EF9DFC.6FB4@csehp3.mdc.com>, James A. Squire wrote: [quoting the Rationale] >variable. As with a normal variable, it is an error to depend on the >value of an out parameter prior to its being initialized." then commenting: > >but I don't know if that's a compiler error or a run-time error. From >the context, I'd guess a run-time error. It _cannot_ be a compiler error, because in general it is undecidable whether a variable is used before it is initialized. A friendly compiler can give a compilation _warning_. Now, will it be a runtime error? That is, will it cause an exception to be raised? Maybe. This is a special case - as the Rationale mentioned - of an ordinary uninitialized variable. We must assume that an uninitialized variable has an arbitrary value, which may or may not be in range. We've had recurring threads on this issue in this newsgroup. That the uninitialized object happens to be an OUT parameter doesn;t change anything. Mike Feldman