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,75a8a3664688f227 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-09 22:39:45 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!hub.org!hub.org!newsfeed.wirehub.nl!news.tele.dk!193.174.75.178!news-fra1.dfn.de!news-koe1.dfn.de!news-han1.dfn.de!news.fh-hannover.de!news.cid.net!news.enyo.de!news1.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Parameter Modes, In In Out and Out Date: 09 Jan 2001 22:46:02 +0100 Organization: Enyo's not your organization Message-ID: <87ae90l7qd.fsf@deneb.enyo.de> References: <86itno316m.fsf@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: supernews.google.com comp.lang.ada:3849 Date: 2001-01-09T22:46:02+01:00 List-Id: Laurent Guerby writes: > if your compiler uses by copy passing for integer, Scalar types are elmentary types and are therefore passed by copy. > you'll probably get a program_error, because the generated code for > exiting P will set X with an unitialized stack value (the place > reserved for the Y value). Or a Constraint_Error, or a Program_Error raised explicitly by your code, or nothing. Speaking of out-mode pass-by-copy parameters, I've encountered another odd thing. Given the following code: procedure Do_Something_With (X : Integer); procedure Foo (X : out Integer) is begin raise Constraint_Error; end Foo; declare Y : Integer := 0; begin begin Foo (Y); exception when Constraint_Error => null; end; Do_Something_With (Y); end; Is it guaranteed by the language that Y is 0 when Do_Something_With is called? (Or, put the other way round, can a compiler perform dead-store elimination in this context?)