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: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: To Initialise or not Date: 1996/05/02 Message-ID: #1/1 X-Deja-AN: 152575277 references: <318508FE.204B@sanders.lockheed.com> <3184E9CE.5C7A@lmtas.lmco.com> <3185E379.7C20@lmtas.lmco.com> <318792E8.28CC1042@escmail.orl.mmc.com> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-05-02T00:00:00+00:00 List-Id: T.E.D. said "Yes, but I don't think any compiler COULD easily help enforce this (It sounds a lot like the halting problem to me). That is what code walkthroughs are for." (speaking of the idea of considering it to be "wrong" to reference a default initialized access value. Help means help. It does not mean solving the halting problem. It is perfectly fine and easy for a compiler to give warnings in simple cases (it is no different from giving these warnings for the cases of other datatypes, such as integer). You can do it some of the time, and that is helpful. For example: procedure q is type x is access integer; y : x; z : x; begin z := y; end; This could certainly give a diagnostic if the appropriate option is set. I almost wondered if it should give a diagnostic ("y is never assigned a value") warning unconditionally. One version of GNAT did so, then we took it out. This is yet another case where I miss the capability of having a default initialized constant. Yes in this case we could say y : constant x := null; but in the record case, there is no easy way of doing this.