comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: To Initialise or not
Date: 1996/05/02
Date: 1996-05-02T00:00:00+00:00	[thread overview]
Message-ID: <dewar.831032134@schonberg> (raw)
In-Reply-To: 318792E8.28CC1042@escmail.orl.mmc.com


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.





  parent reply	other threads:[~1996-05-02  0:00 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-29  0:00 To Initialise or not Steve O'Neill
1996-04-29  0:00 ` Ken Garlington
1996-04-29  0:00   ` Robert Dewar
1996-04-30  0:00     ` Ken Garlington
1996-04-30  0:00   ` Robert A Duff
1996-04-30  0:00     ` Robert A Duff
1996-04-30  0:00     ` Ken Garlington
1996-04-30  0:00       ` Robert A Duff
1996-05-01  0:00         ` Keith Thompson
1996-05-01  0:00           ` Robert A Duff
1996-05-02  0:00             ` Keith Thompson
1996-05-03  0:00               ` Robert A Duff
1996-05-01  0:00           ` Theodore E. Dennison
1996-05-01  0:00             ` Robert A Duff
1996-05-02  0:00               ` Michael F Brenner
1996-05-02  0:00                 ` Robert A Duff
1996-05-04  0:00                   ` Kevin D. Heatwole
1996-05-02  0:00               ` Theodore E. Dennison
1996-05-02  0:00                 ` Robert A Duff
1996-05-02  0:00                 ` Chris Warack <sys mgr>
1996-05-02  0:00                   ` Robert A Duff
1996-05-06  0:00                   ` Ken Garlington
1996-05-06  0:00               ` Ken Garlington
1996-05-07  0:00                 ` Robert A Duff
1996-05-08  0:00                   ` Ken Garlington
1996-05-08  0:00                     ` Robert A Duff
1996-05-09  0:00                       ` Ken Garlington
1996-05-09  0:00                         ` Robert A Duff
1996-05-01  0:00             ` Dale Stanbrough
1996-05-02  0:00             ` Robert Dewar [this message]
1996-05-02  0:00               ` Robert A Duff
1996-05-02  0:00               ` Theodore E. Dennison
1996-05-06  0:00           ` Ken Garlington
1996-05-06  0:00         ` Ken Garlington
1996-05-07  0:00           ` Robert A Duff
1996-05-08  0:00             ` Ken Garlington
1996-05-09  0:00               ` Robert A Duff
1996-05-10  0:00                 ` Robert A Duff
1996-05-10  0:00                   ` Ken Garlington
1996-05-10  0:00                     ` Robert A Duff
1996-05-10  0:00                       ` Ken Garlington
1996-05-11  0:00                         ` David Kristola
1996-05-11  0:00                           ` Robert A Duff
1996-05-11  0:00                         ` Robert A Duff
1996-05-13  0:00                 ` Ken Garlington
1996-05-13  0:00                   ` Robert A Duff
1996-05-13  0:00                     ` Ken Garlington
1996-05-13  0:00                   ` Ken Garlington
1996-05-13  0:00                     ` Robert A Duff
1996-05-13  0:00                       ` Ken Garlington
1996-05-01  0:00     ` Patrick Richard Wibbeler
1996-05-06  0:00       ` Ken Garlington
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox