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,11c630572e59f461 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!v33g2000cwv.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Re: Bug in GNAT GPL 2006? Date: 21 Feb 2007 18:14:04 -0800 Organization: http://groups.google.com Message-ID: <1172110443.971020.58150@v33g2000cwv.googlegroups.com> References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1172110449 4512 127.0.0.1 (22 Feb 2007 02:14:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 22 Feb 2007 02:14:09 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: v33g2000cwv.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news2.google.com comp.lang.ada:9391 Date: 2007-02-21T18:14:04-08:00 List-Id: On Feb 21, 12:19 pm, "Randy Brukardt" wrote: > Bill Findlay writes: > > Using GNAT GPL 2006 (20060522-34) I get warning messages > > like the following when using extended return statements: > > > function is_empty (the_table : a_safe_table) return Boolean is > > begin > > return result : Boolean do > > | > > >>> warning: variable "result" is assigned but never read > > > lock_table; > > result := is_empty(a_basic_table(the_table)); > > unlock_table; > > end return; > > end is_empty; > > > I'm inclined to assume that this is a compiler bug, but can > > anyone more knowledgeable about Ada 200[57] confirm this? > > Sure looks like a (harmless) compiler bug to me. It's hard to imagine why > you would be required to read the result of a function before returning it. Looks to me like the compiler is (incorrectly) pretending it's a normal variable. If you had declared "result : Boolean" before the "begin", and then assigned it but never used it, I can imagine the compiler being suspicious that something was perhaps mistyped somewhere, and displaying a warning. Just a very understandable implementation bug. -- Adam