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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cf6748b54b098108 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-08 10:13:07 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: OUT = IN OUT for pointers ??? X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3BEAC50F.5359DDB5@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: <3BEA84A1.464B0D82@earthlink.net> Mime-Version: 1.0 Date: Thu, 8 Nov 2001 17:46:55 GMT X-Mailer: Mozilla 4.73 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:16079 Date: 2001-11-08T17:46:55+00:00 List-Id: "Marc A. Criley" wrote: > > It kinda depends on the code where this is occurring. Generally, an > 'out' mode parameter is to be treated as an uninitialized local > variable, meaning that it could contain any sequence of bits--which may > or may not designate a valid value. There are important exceptions to this, see ARM 6.4.1. Of interest to this question, 6.4.1(7) says "For an out parameter that is passed by copy ...: For an access type, the formal parameter is initialized from the value of the actual, without a constraint check" For pass-by-reference types, types with discriminants, and types with implicit initial values, there is no difference between mode out and mode in out. Mode out can be relied on to be significantly different from mode in out only for numeric and enumeration types. > > Since a compiler will commonly pass an out parameter as (in effect) the > address of the argument, an initial value possessed by that argument may > be unintentionally made available to the subprogram body. Depending on > and using such a value, however, is erroneous. However, elementary types, which include access types, are always passed by copy. -- Jeffrey Carter