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,f71c159449d6e114 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Ada 83 - avoiding unchecked conversions. Date: 1996/12/26 Message-ID: #1/1 X-Deja-AN: 206049019 references: <32AED68A.48BE@aisf.com> <32b03008.564464@netnews.worldnet.att.net> <58np72$9qp@news.nyu.edu> <32B6905F.FC4@tiac.net> organization: New York University newsgroups: comp.lang.ada Date: 1996-12-26T00:00:00+00:00 List-Id: Keity says "I agree that the compiler needs to emit a shift for this case, but it shouldn't generate a check that the result is within the declared range of its subtype. This makes it the programmer's responsibility to guarantee that the result will be a valid value of the target subtype (if possible, by using a target subtype that covers all possible bit patterns), or to deal with it properly if it isn't." Notice that the shouldn't here corresponds to implementation advice in the RM, not to any requirement, so code that counts on there being no check is potentially non-portable.