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: Ken Garlington Subject: Re: To Initialise or not Date: 1996/05/09 Message-ID: <3191E6E3.453@lmtas.lmco.com>#1/1 X-Deja-AN: 153924115 references: <318508FE.204B@sanders.lockheed.com> <318E43A4.390E@lmtas.lmco.com> <31909E74.1E09@lmtas.lmco.com> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Tactical Aircraft Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.01 (Macintosh; I; 68K) Date: 1996-05-09T00:00:00+00:00 List-Id: 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"