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: bobduff@world.std.com (Robert A Duff) Subject: Re: Rules for Representation of Subtypes Date: 1996/09/30 Message-ID: #1/1 X-Deja-AN: 186300607 references: <1996Sep28.155354.1@eisner> <1996Sep29.082143.1@eisner> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-09-30T00:00:00+00:00 List-Id: 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. - Bob