comp.lang.ada
 help / color / mirror / Atom feed
From: Ken Garlington <garlingtonke@lmtas.lmco.com>
Subject: Re: To Initialise or not
Date: 1996/05/09
Date: 1996-05-09T00:00:00+00:00	[thread overview]
Message-ID: <3191E6E3.453@lmtas.lmco.com> (raw)
In-Reply-To: Dr3yzz.52C@world.std.com


Robert A Duff wrote:
> 
> Heh?  I said, "all cases".  The 'Valid attribute is *one* case.  I
> meant, pragma Normalize_Scalars will not cause every read of an
> uninitialized scalar to be detected.  Am I confused?  I thought we were
> talking about pragma Normalize_Scalars, not the 'Valid attribute.

You use Normalize_Scalars with 'Valid to test for uninitialized scalars.
At least, that's the way I would do it!

Sort of like using default initialization of access objects with comparison
to mull (or by attempting a dereference, if you want the implicit
exception instead of raising your own). The initialization by itself
doesn't do anything magical, and certainly the value "null" for access
values doesn't cause every read of a null access value to be "detected"
(exception raised?).

> >For scalar X, X'Valid "yields True if and only if the object
> >denoted by X is normal and has a valid representation."
> 
> Yes.  But be careful -- anything that's erroneous will negate that rule.

I guess my understand of erroneous (and maybe this is an Ada 83-only
understanding) is that erroneous code pretty much negated _all_ Ada rules.
If you want to reliably detect the results of erroneous code, you have to
step outside the standard, right?

> 
> >Certainly, if there is _no_ invalid representation of X, then
> >'Valid won't detect any. However, you should be able to use 'Size
> >to force the existence of an invalid representation for any
> >scalar, right?
> 
> No, I don't think so.  An implementation might allow it, but where does
> the RM require an implementation to accept such a Size clause?  (Note:
> The ARG is considering some AI's related to this issues, notably AI's 51
> and 109, in case you care to comment.)

Since I don't generally get to see AIs, I can't comment on them. However,
my (possibly naive) reading of RM95:13.3:39-43 is that I can always cause an
object to use more than the minimum amount of bits. I suspect that there
may not be a _portable_ definition of Size in all cases, but it at least seems
there should be _some_ value that would work for any given compiler.

> 
> - Bob

-- 
LMTAS - "Our Brand Means Quality"




  reply	other threads:[~1996-05-09  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     ` 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 [this message]
1996-05-09  0:00                         ` Robert A Duff
1996-05-02  0:00             ` Robert Dewar
1996-05-02  0:00               ` Robert A Duff
1996-05-02  0:00               ` Theodore E. Dennison
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-04-30  0:00     ` Robert A Duff
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