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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.254.197 with SMTP id ak5mr14861312pad.20.1430073723128; Sun, 26 Apr 2015 11:42:03 -0700 (PDT) X-Received: by 10.140.104.72 with SMTP id z66mr78070qge.14.1430073723082; Sun, 26 Apr 2015 11:42:03 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!l13no10422082iga.0!news-out.google.com!k20ni1096qgd.0!nntp.google.com!z60no3860634qgd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 26 Apr 2015 11:42:02 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=105.236.88.21; posting-account=orbgeAkAAADzWCTlruxuX_Ts4lIq8C5J NNTP-Posting-Host: 105.236.88.21 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Change in GCC 5.1.0 From: jan.de.kruyf@gmail.com Injection-Date: Sun, 26 Apr 2015 18:42:03 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:25642 Date: 2015-04-26T11:42:02-07:00 List-Id: On Sunday, April 26, 2015 at 6:51:54 PM UTC+2, Simon Wright wrote: > GCC 4.9.1 (and presumably GNAT GPL 2014) allowed variable indexing on a > Set, even though there was no Variable_Indexing aspect in the spec. >=20 > GCC 5.1.0 doesn't. >=20 > So this code (from Gprbuild GPL 2014) compiled and, presumably, worked > when it shouldn't have: >=20 > with Ada.Containers.Ordered_Sets; > procedure Iteration is > type Slave is new Integer; > package Slave_S is new Ada.Containers.Ordered_Sets > (Element_Type =3D> Slave); > Pool : Slave_S.Set; > procedure Iterate (Proc : access procedure (S : in out Slave)) is > begin > for C in Pool.Iterate loop > declare > S : Slave :=3D Slave_S.Element (C); > begin > Proc (S); > Pool (C) :=3D S; -- <<<<<<<<<<<<<<< wrong > end; > end loop; > end Iterate; > begin > null; > end Iteration; >=20 > The thing about an (ordered) set is that replacing an element must > involve re-ordering the set, in case the element's position has > changed. So the compilable code in this case is >=20 > Pool.Replace_Element (C, S); >=20 > That said, that looks awfully like tampering to me (if the order > changes, anyway). I await Gprbuild GPL 2015 with interest. Hi Simon, Just to dampen your expectations a bit: ------------------- $ gcc --version gcc (GCC) 4.7.4 20140401 for GNAT GPL gpl-2014 (20140405) Copyright (C) 2012 Free Software Foundation, Inc. ------------------- And I had Ada code braking before, that should never have passed the compil= er in the first place (shame on me). On another note: I promised to do a write up on my embedded runtime develop= ment.. Well the runtime is going ok, but the laptop with my notes on it was= nicked, so I went through the moves of rebuilding my development system et= c, the last couple of weeks. The work itself was safe though. And by the way there is still a fair bit of 32 bit stuff in the present Gna= t release for Linux. So as soon as I see that the board is running ok, i.e. the runtime is reaso= nably tested, I will try to do a summary. Cheers, j.