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/01 Message-ID: <325155A5.2E50@lmtas.lmco.com>#1/1 X-Deja-AN: 186558382 references: <1996Sep28.155354.1@eisner> <1996Sep29.082143.1@eisner> 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-01T00:00:00+00:00 List-Id: Robert A Duff wrote: > > In article <1996Sep29.082143.1@eisner>, > Larry Kilgallen wrote: > >But my X'valid should still work. And compilers are not allowed to > >change the flow of a program. > > > > X := my_unchecked_conversion(Y); > > > > if X'valid > > It depends on how you instantiated my_unchecked_conversion. If you used > a constrained integer, such that some values of Y will produce > out-of-range results, then it's erroneous, and the 'Valid will *not* > work. Hence, my advice to always unchecked_convert to types that match > the hardware. 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? > > - Bob -- LMTAS - "Our Brand Means Quality"