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: a07f3367d7,3737542e2ed2b8e1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!news.unit0.net!feeder8.cambrium.nl!feed.tweaknews.nl!195.238.0.231.MISMATCH!news.skynet.be!195.238.0.222.MISMATCH!newsspl501.isp.belgacom.be!tjb!not-for-mail Date: Tue, 28 Apr 2009 21:15:48 +0200 From: Olivier Scalbert User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Problem with optimizations References: <49f73730$0$2850$ba620e4c@news.skynet.be> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <49f755e0$0$2850$ba620e4c@news.skynet.be> Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: ce69ce51.news.skynet.be X-Trace: 1240946144 news.skynet.be 2850 87.65.130.237:60460 X-Complaints-To: usenet-abuse@skynet.be Xref: g2news2.google.com comp.lang.ada:5590 Date: 2009-04-28T21:15:48+02:00 List-Id: Albrecht K�fer wrote: > (see below) schrieb:: >> There is no else part for the following if: >> >> if Is_Solved(Cube) then >> New_Line; >> Put("Solved !"); New_Line; >> >> for i in 1..depth-1 loop >> Ada.Integer_Text_IO.Put(Integer(Moves(i))); >> end loop; >> Result := True; >> end if; >> >> So the procedure can exit with Result undefined. Since the program is >> incorrect, varying optimisation, or implementation details, is likely to >> give varying results. Some may co-incidentally be the results you expect. > > Shouldn't that, you know, create a warning or something? > > > Albrecht That is what I was thinking, but with: gnatmake -f -O3 -W -gnatp rubikmain it detects the bug (and also an other one in the same function) Shame on me !