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/18 Message-ID: #1/1 X-Deja-AN: 204771814 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-18T00:00:00+00:00 List-Id: iEric said "using overlays. Apparently on that compiler (VAX Ada 1.something) unchecked conversion was doing some checks. " Note that the unchecked in unchecked conversion is talking about omitting normal compile time checks for type correctness. It is NOT talking about runtime checking (whatever that might mean). In general you cannot assume that unchecked conversion takes no code. Some of the time it may take no code, but there is no reason to think, or even considerable desirable, that a compiler would never generate code for an unchecked conversion. Sometimes you would get the wrong result in the absence of generating code. For example, suppose that packed 5 bit arrays were stored left justified in a register, and 5 bit integers were stored right justified. Well the compiler had beetter emit a shift for the unchecked conversion or it will get the wrong result (remembr that the semantics of unchecked conversion is quite well defined, it is not some kind of implementation dependent unknown op0eration).