comp.lang.ada
 help / color / mirror / Atom feed
From: "Theodore E. Dennison" <dennison@escmail.orl.mmc.com>
Subject: Re: [Q] To initialise or not.
Date: 1996/04/26
Date: 1996-04-26T00:00:00+00:00	[thread overview]
Message-ID: <318109B1.3B54AFBF@escmail.orl.mmc.com> (raw)
In-Reply-To: 484274071wnr@diphi.demon.co.uk


JP Thornley wrote:
> 
> We are currently looking at revision of the Ada coding standards
> (probably based closely on the Ada Quality and Style Guidelines as
> advised elsewhere).
> 
> However the issue of whether or not to require all scalar objects to be
> initialised has generated a substantial discussion without yet reaching
> a clear conclusion.  The Ada Quality and Style Guidelines are silent on
> this issue, so I would be interested in what other Ada users have found
> and what recommendations they would make.

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."

In pracitice you don't even need to throw words like "erronious" around,
because a program that reads from an uninitialized variable generally
won't work. 

I don't see the overriding need to write a procedure to forbid every
possible erronious practice. But if you do, I'd just phrase it to 
forbid the situation above- "The program shall not attempt to evaluate
a scalar variable that has not been initialized".

-- 
T.E.D.          
                |  Work - mailto:dennison@escmail.orl.mmc.com  |
                |  Home - mailto:dennison@iag.net              |
                |  URL  - http://www.iag.net/~dennison         |




  reply	other threads:[~1996-04-26  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-25  0:00 [Q] To initialise or not JP Thornley
1996-04-26  0:00 ` Theodore E. Dennison [this message]
1996-04-26  0:00   ` Robert A Duff
1996-04-27  0:00     ` Thorsten Behrens
1996-04-28  0:00       ` Robert Dewar
1996-04-30  0:00       ` mjp
1996-05-02  0:00       ` Bob Gilbert
1996-04-26  0:00 ` Ken Garlington
1996-04-26  0:00 ` Robert I. Eachus
1996-04-26  0:00 ` Ken Garlington
1996-04-26  0:00   ` Robert A Duff
1996-04-27  0:00   ` Robert Dewar
1996-04-27  0:00     ` Robert A Duff
1996-04-27  0:00 ` Robert Dewar
replies disabled

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