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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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: "G.B." Newsgroups: comp.lang.ada Subject: Re: Bounded String question Date: Thu, 12 Nov 2015 19:03:17 +0100 Organization: A noiseless patient Spider Message-ID: References: <7ba56b33-28d4-42d2-8b9b-5ad9f5beab8b@googlegroups.com> <87io597447.fsf@theworld.com> <66278720-249a-4191-a908-bb840e7f3ccc@googlegroups.com> <6d874e75-e2c9-47e9-b394-f04052f10aa3@googlegroups.com> <1a532527-f48c-4646-abb5-ec64b5e6106b@googlegroups.com> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 12 Nov 2015 18:01:00 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="32387"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198T4HAd7iwRuMY6w+1t4bFOyd1vQkyszI=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: <1a532527-f48c-4646-abb5-ec64b5e6106b@googlegroups.com> Cancel-Lock: sha1:/qECPfN7J2R6MUB8G6SNC5zveL0= Xref: news.eternal-september.org comp.lang.ada:28321 Date: 2015-11-12T19:03:17+01:00 List-Id: On 11.11.15 21:40, AdaMagica wrote: > Am Mittwoch, 11. November 2015 21:32:39 UTC+1 schrieb Serge Robyns: >> This how this whole thread started. That construct does not work >> with pragma preelaborate. But this was exactly the code I had initially :-) > > No complaint from GNAT GPL 2015: > -------------------------------- > > with Ada.Strings; use Ada.Strings; > with Ada.Strings.Bounded; > > procedure BS_Test is > > pragma Preelaborate; Are the requirements for Elaborate (or for Pure) different for a library unit that is a subprogram? GNAT does not rejected this "pure" one either: procedure Purity (A : Integer) is pragma Pure (Purity); type P is access String; X : P := new String'("abc"); Y : String := Integer'Image (A); Z : String := Y (1) & Y (A); begin Y (3) := X (1); end Purity; Diagnostics change in the opposite direction when the same declarations appear in a package spec.