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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Change in GCC 5.1.0 Date: Sun, 26 Apr 2015 17:51:52 +0100 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="64b4c1505dbd9f45d064ed0ede641202"; logging-data="12600"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RqzerO+5oqBQPOibYE1zid66U4JuawE4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) Cancel-Lock: sha1:w3G/zOJEDP19DuTlYZ2PmvbXWHg= sha1:wR0tbvLiit9/HB/zosh4Rhn/q5c= Xref: news.eternal-september.org comp.lang.ada:25641 Date: 2015-04-26T17:51:52+01:00 List-Id: 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. GCC 5.1.0 doesn't. So this code (from Gprbuild GPL 2014) compiled and, presumably, worked when it shouldn't have: with Ada.Containers.Ordered_Sets; procedure Iteration is type Slave is new Integer; package Slave_S is new Ada.Containers.Ordered_Sets (Element_Type => 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 := Slave_S.Element (C); begin Proc (S); Pool (C) := S; -- <<<<<<<<<<<<<<< wrong end; end loop; end Iterate; begin null; end Iteration; 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 Pool.Replace_Element (C, S); That said, that looks awfully like tampering to me (if the order changes, anyway). I await Gprbuild GPL 2015 with interest.