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.129.154.215 with SMTP id r206mr16703806ywg.35.1467369637946; Fri, 01 Jul 2016 03:40:37 -0700 (PDT) X-Received: by 10.157.39.133 with SMTP id c5mr766436otb.6.1467369637875; Fri, 01 Jul 2016 03:40:37 -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!jk6no8191560igb.0!news-out.google.com!d62ni8775ith.0!nntp.google.com!jk6no8191550igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 1 Jul 2016 03:40:37 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8202:8510:5985:2c17:9409:aa9c; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8202:8510:5985:2c17:9409:aa9c References: <57346ac8$0$4570$426a74cc@news.free.fr> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Ada.Strings.Fixed.Count raises Storage_Error From: rieachus@comcast.net Injection-Date: Fri, 01 Jul 2016 10:40:37 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:30987 Date: 2016-07-01T03:40:37-07:00 List-Id: On Thursday, June 30, 2016 at 1:38:50 AM UTC-4, Niklas Holsti wrote: > Regarding Rosen's pathology, your explanation shows that it was a severe= =20 > one and really required a change in the language definition. A different= =20 > kind of thing than the possible problems of Strings extending to=20 > Integer'Last. No it is not. There was a huge amount of wrangling about the consequences = of the type Integer being 16-bits in size in Ada 83. The classic issue was= that code for loops generated normally would never terminate for a loop ov= er Integer'Range. (Strings were fine because they began at +1.) Over the next few years, it became common for even Ada compilers for 16-bit= word size systems to support a 32-bit Integer type. Then came machines wit= h 64-bit integer registers and operations, and now, RM 3.5.4(11), Integer i= s a constrained subtype, and 64-bit registers can be used to count Integer = loops without a problem. But the problem does come back for 64-bit or 128-= bit or whatever types. No one is going to write a test which would outlast= the physical machine, so we can ignore the issue--sort of. You can go wri= te a loop that runs from System.Min_Int .. System.Max_Int and inspect the c= ode generated to see if it is correct. I consider this issue to be a subcase of this pathology. On machines with = 64-bit registers and a 32-bit Integer type, the generated code should be fi= ne.