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,f188b1cd9c1f24dc X-Google-Attributes: gid103376,public From: "Corey Ashford" Subject: Re: Parameter evaluation order Date: 1998/04/06 Message-ID: <6ga50i$f29$1@usenet.rational.com>#1/1 X-Deja-AN: 341296958 References: <6g9d2o$tfg$1@nnrp1.dejanews.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: Rational Software Newsgroups: comp.lang.ada Date: 1998-04-06T00:00:00+00:00 List-Id: Mark.Rutten@dsto.defence.gov.au wrote in message <6g9d2o$tfg$1@nnrp1.dejanews.com>... > > >I'm using GNAT3.09 on WindowsNT (and also Solaris, but I didn't get >this problem). > >I compiled a procedure call similar to the following > > proc(func_one,func_two); > >The program relies on func_one being called _before_ func_two. But >at run-time the code above did the opposite! Is this a bug (and if so, has it >been fixed in 3.10)? Or is there something written in the language definition >to justify this behaviour? > >Thanks, >Mark Rutten See the Ada RM 6.4 (10) (10) For the execution of a subprogram call, the name or prefix of the call is evaluated, and each parameter_association is evaluated (see 6.4.1). If a default_expression is used, an implicit parameter_association is assumed for this rule. These evaluations are done in an arbitrary order. The subprogram_body is then executed. Finally, if the subprogram completes normally, then after it is left, any necessary assigning back of formal to actual parameters occurs (see 6.4.1).