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,612ea65294f56d25,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bill Findlay Newsgroups: comp.lang.ada Subject: Syntax of extended return statement Date: Wed, 16 Mar 2011 00:01:01 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: individual.net EeU2T4oktDsITJf+hMnvRw94HS7RIBy8pqw1u4262hpM+eYJEJ Cancel-Lock: sha1:26TEo4EvA9J80AYXpDHKLfhbNf4= User-Agent: Microsoft-Entourage/12.28.0.101117 Thread-Topic: Syntax of extended return statement Thread-Index: AcvjbTwidYClJvEONE+/sxRI5II/OQ== Xref: g2news1.google.com comp.lang.ada:18229 Date: 2011-03-16T00:01:01+00:00 List-Id: I have the following compilation warning from GNAT: function pop return KDF9.word is begin the_nest_depth := the_nest_depth - 1; return result : KDF9.word := the_nest(the_nest_depth) do | >>> warning: "result" is not modified, could be declared constant the_nest(the_nest_depth) := 0; end return; end pop; If I change the return statement to: return result : constant KDF9.word := the_nest(the_nest_depth) do the_nest(the_nest_depth) := 0; end return; it compiles without warning. My problem is that I see no justification for that in the Ada 2005 RM, which gives: extended_return_statement ::= return defining_identifier:[aliased] return_subtype_indication[:=expression] [do handled_sequence_of_statements end return]; return_subtype_indication ::= subtype_indication | access_definition Can anyone enlighten me? -- Bill Findlay with blueyonder.co.uk; use surname & forename;