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: bobduff@world.std.com (Robert A Duff) Subject: Re: Ada 83 - avoiding unchecked conversions. Date: 1996/12/18 Message-ID: #1/1 X-Deja-AN: 204823984 references: <58np72$9qp@news.nyu.edu> <32B6905F.FC4@tiac.net> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-12-18T00:00:00+00:00 List-Id: In article , Robert Dewar wrote: >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 Another efficiency issue about unch_conv is whether or not it makes a copy. An instance of U_C is a function, so one would normally assume that calling it makes a copy of the argument. This is what the Ada 83 RM said, and this is no doubt why U_C was inefficient in some early version of VAX Ada. However, the Ada 83 ARG ruled that the function result may be returned by reference in some cases, and Ada 95 agrees with that ruling (see 13.9(12)). So if you do: Some_Procedure(Unch_Conv(X)); then Some_Procedure might actually be receiving the address of X, rather than the address of a copy of X. This is different (and often more efficient) than the semantics normal function calls. And the difference is detectable. - Bob