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,45a9122ddf5fcf5 X-Google-Attributes: gid103376,public From: Ken Garlington Subject: Re: Rules for Representation of Subtypes Date: 1996/10/02 Message-ID: <3252BAF0.4C3F@lmtas.lmco.com>#1/1 X-Deja-AN: 186808907 references: <1996Sep29.082143.1@eisner> <325155A5.2E50@lmtas.lmco.com> to: Robert A Duff cc: dewar@gnat.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.02 (Macintosh; I; 68K) Date: 1996-10-02T00:00:00+00:00 List-Id: Robert A Duff wrote: > > In article <325155A5.2E50@lmtas.lmco.com>, > Ken Garlington wrote: > >I seem to remember some AI about using unchecked_conversion when the > >sizes of X and Y are different. Maybe it's compiler dependent, but I > >thought you were at least guaranteed that the unchecked_conversion of Y > >would _fit_ into the space allocated for X, although of course Y might > >be outside the range of X. In that case, X'Valid should work, shouldn't > >it? > > No. See 13.9.1(12). Nothing, not even 'Valid, can be assumed to work, > if the execution is erroneous. > > - Bob So all that discussion in the Ada 83 AI-00590 is wasted when we get to Ada 95? What a crock! I'd also say that 13.9.2:1 and 13.9.2:4-12 are very misleading, at best, if this is the case. It sounds like I would have to write a kludge, wrapping my scalar inside a record, as the result of my input routine, unchecked conversion, etc. I hope GNAT and the other compilers raise a warning if I apply 'Valid to something that is not a record component! -- LMTAS - "Our Brand Means Quality" For more info, see http://www.lmtas.com or http://www.lmco.com