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,FREEMAIL_FROM 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!postnews.google.com!v1g2000prd.googlegroups.com!not-for-mail From: johnscpg@googlemail.com Newsgroups: comp.lang.ada Subject: Re: Problem with optimizations Date: Wed, 29 Apr 2009 03:36:50 -0700 (PDT) Organization: http://groups.google.com Message-ID: <72553200-482d-4d4b-b4ff-e99159897fb1@v1g2000prd.googlegroups.com> References: <49f73730$0$2850$ba620e4c@news.skynet.be> <49f755e0$0$2850$ba620e4c@news.skynet.be> NNTP-Posting-Host: 143.117.23.126 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1241046650 448 127.0.0.1 (29 Apr 2009 23:10:50 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 29 Apr 2009 23:10:50 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v1g2000prd.googlegroups.com; posting-host=143.117.23.126; posting-account=Jzt5lQoAAAB4PhTgRLOPGuTLd_K1LY-C User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.7) Gecko/2009032813 Iceweasel/3.0.6 (Debian-3.0.6-1),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5614 Date: 2009-04-29T03:36:50-07:00 List-Id: On Apr 28, 8:15=A0pm, Olivier Scalbert wrote: > Albrecht K=E4fer wrote: > > (see below) schrieb:: > >> There is no else part for the following if: > > >> =A0 =A0 =A0 =A0 =A0 =A0 if Is_Solved(Cube) then > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 New_Line; > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Put("Solved !"); New_Line; > > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 for i in 1..depth-1 loop > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Ada.Integer_Text_IO.Put(Intege= r(Moves(i))); > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 end loop; > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Result :=3D True; > >> =A0 =A0 =A0 =A0 =A0 =A0 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 expe= ct. > > > 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 !