comp.lang.ada
 help / color / mirror / Atom feed
* To Initialise or not
@ 1996-04-29  0:00 Steve O'Neill
  1996-04-29  0:00 ` Ken Garlington
  0 siblings, 1 reply; 52+ messages in thread
From: Steve O'Neill @ 1996-04-29  0:00 UTC (permalink / raw)



Robert A Duff wrote:
> In article <318109B1.3B54AFBF@escmail.orl.mmc.com>,
> Theodore E. Dennison <dennison@escmail.orl.mmc.com> wrote:
> >I suspect it is silent on this issue, because the Ada (83) LRM is
> >NOT silent on the issue. Section 3.2.1(18) reads:
> >"The execution of a program is erroneous if it attempts to evaluate a
> > scalar variable with an undefined value."
>
> My personal coding convention is to *not* initialize variables if I know
> they will be properly initialized later.  <snip>

Another situation where initialization is ill-advised is when dealing with 
memory-mapped hardware registers.  It could be disastrous to write initial
values to such a register which is 'pre-initialized' by the hardware.  This 
is obviously a special case, but one that should not be ignored when dictating
that all variables be initialized by the software (either by developers or
automatically).

> As an aside, I always write ":= null;" when I want to *rely* on the
> initial value of a pointer, even though I know that pointers are always
> default-initialized to null.

You're not the only one. :)

-- 
Steve O'Neill                      | "No,no,no, don't tug on that!
Sanders, A Lockheed Martin Company |  You never know what it might
smoneill@sanders.lockheed.com      |  be attached to." 
(603) 885-8774  fax: (603) 885-4071|    Buckaroo Banzai




^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~1996-05-13  0:00 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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           ` Theodore E. Dennison
1996-05-01  0:00             ` Dale Stanbrough
1996-05-01  0:00             ` Robert A Duff
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-02  0:00               ` Michael F Brenner
1996-05-02  0:00                 ` Robert A Duff
1996-05-04  0:00                   ` Kevin D. Heatwole
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-02  0:00             ` Robert Dewar
1996-05-02  0:00               ` Theodore E. Dennison
1996-05-02  0:00               ` Robert A Duff
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-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                   ` Ken Garlington
1996-05-13  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-01  0:00     ` Patrick Richard Wibbeler
1996-05-06  0:00       ` Ken Garlington

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