From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!XKkOg2NWh5z4wmge2MDKgw.user.gioia.aioe.org.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Lower bounds of Strings Date: Tue, 05 Jan 2021 12:49:04 +0000 Organization: Aioe.org NNTP Server Message-ID: References: <1cc09f04-98f2-4ef3-ac84-9a9ca5aa3fd5n@googlegroups.com> NNTP-Posting-Host: XKkOg2NWh5z4wmge2MDKgw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:rZ+rfu1jzox2+j3M1Q0+8nItJN0= Xref: reader02.eternal-september.org comp.lang.ada:61040 List-Id: Stephen Davies writes: > Not only is it ugly, but it's potentially dangerous if code uses the > latter and works for ages until one day somebody passes a slice > instead of a string starting at 1 (yes, compilers might generate > warnings, but that doesn't negate the issue, imho). I suppose you could use a precondition. I had a similar problem with the Ada 2005 Math Extensions[1], where the Ada code supports arbitrary ranges on the input & output matrices (well, I did insist that the output ranges matches the inputs!) but the underlying Fortran code assumes that ranges start at 1 .. hmm. I see from a perfunctory search that F90 allows arbitrary ranges. Still, LAPACK seems not to ...[2] I see that current GNATs give a lot of warnings about use of an anonymous access type allocator. [1] http://gnat-math-extn.sourceforge.net/index.html/ [2] http://www.netlib.org/lapack/explore-html/d3/dfb/group__real_g_eeigen_ga6176eadcb5a027beb0b000fbf74f9e35.html#ga6176eadcb5a027beb0b000fbf74f9e35