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-Thread: 103376,b3f788f59498d3af,start X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!spamkiller.gnilink.net!gnilink.net!trnddc04.POSTED!72fcb693!not-for-mail From: Fionn Mac Cumhaill Newsgroups: comp.lang.ada Subject: Exceptions and out procedure arguments (using GNAT GPL) Message-ID: <79c673pq5htg508nkoi935n3udqg5ps7r8@4ax.com> X-Newsreader: Forte Agent 4.2/32.1118 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 16 Jun 2007 01:05:10 GMT NNTP-Posting-Host: 71.164.246.37 X-Complaints-To: abuse@verizon.net X-Trace: trnddc04 1181955910 71.164.246.37 (Fri, 15 Jun 2007 21:05:10 EDT) NNTP-Posting-Date: Fri, 15 Jun 2007 21:05:10 EDT Xref: g2news1.google.com comp.lang.ada:16202 X-Original-Bytes: 1445 Date: 2007-06-16T01:05:10+00:00 List-Id: Consider a procedure that starts like this: procedure My_Procedure ( O: out integer ) is begin -- various statements follow O := 999; -- more statements follow raise My_Exception; I'm using GNAT GPL. My question is: Is the routine which calls My_Procedure guaranteed to get a value if it does something like this? X := 0; My_Procedure(X); and has an exception handler exception when My_Exception => null; Will X get a value of 999? I.e., is an Ada compiler free to optimize the code such that the assignment to the out variable O is moved to some place after the point where the exception is raised?