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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b3f788f59498d3af X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!i13g2000prf.googlegroups.com!not-for-mail From: Anh Vo Newsgroups: comp.lang.ada Subject: Re: Exceptions and out procedure arguments (using GNAT GPL) Date: Sat, 16 Jun 2007 01:53:59 -0000 Organization: http://groups.google.com Message-ID: <1181958839.065305.287230@i13g2000prf.googlegroups.com> References: <79c673pq5htg508nkoi935n3udqg5ps7r8@4ax.com> NNTP-Posting-Host: 209.225.225.89 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1181958839 7967 127.0.0.1 (16 Jun 2007 01:53:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 16 Jun 2007 01:53:59 +0000 (UTC) In-Reply-To: <79c673pq5htg508nkoi935n3udqg5ps7r8@4ax.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322; InfoPath.1),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: i13g2000prf.googlegroups.com; posting-host=209.225.225.89; posting-account=JVr7Xg0AAAAI3MbuARxMmvWLmA7qdJMx Xref: g2news1.google.com comp.lang.ada:16203 Date: 2007-06-16T01:53:59+00:00 List-Id: On Jun 15, 6:05 pm, Fionn Mac Cumhaill wrote: > Consider a procedure that starts like this: [...] > 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? When an exception is raised, all bets are off. It is not guaranteed X has a value of 999. However, the exception handler is allowed you to do just that by setting X equal to 999 as shown below ... exception when others => X := 999; ... AV