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-11 11:30:53 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!hub.org!hub.org!newsfeed.direct.ca!look.ca!newsfeed.icl.net!colt.net!newsfeed00.sul.t-online.de!t-online.de!grolier!club-internet!not-for-mail From: Laurent Guerby Newsgroups: comp.lang.ada Subject: Re: Parameter Modes, In In Out and Out Date: 11 Jan 2001 20:28:38 +0100 Organization: Club-Internet (France) Message-ID: <86bstdga6x.fsf@acm.org> References: <86itno316m.fsf@acm.org> <93ilsb$jdf$1@nnrp1.deja.com> NNTP-Posting-Host: nas22-207.vlt.club-internet.fr X-Trace: front2m.grolier.fr 979241170 3725 195.36.172.207 (11 Jan 2001 19:26:10 GMT) NNTP-Posting-Date: 11 Jan 2001 19:26:10 GMT X-Newsreader: Gnus v5.7/Emacs 20.5 Xref: supernews.google.com comp.lang.ada:3920 Date: 2001-01-11T19:26:10+00:00 List-Id: Robert Dewar writes: > Laurent Guerby wrote: > > if your compiler uses by copy passing > > for integer, 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). > > All compilers MUST pass integers by copy, there is no choice. Yes (unless an appropriate pragma is used to overide the mandated Ada passing convention). My wording was sloppy, I meant to talk at the generated code level, not at the Ada copy out semantic here. The idea is that for my example code, the compiler could have done many things, and you'll get the user program_error if and only if the compiler did copy out the parameter at the code level. Other valid behaviours are (I believe) to remove the call, not to copy out, friendly raise some exception at procedure exit, etc... (hence the "probably"). -- Laurent Guerby