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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4fbd260da735f6f4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!usenet-fr.net!gegeweb.org!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Copying string slices before calling subroutines? (Was: Alternative Index implementation?) Date: Fri, 04 May 2007 11:16:24 +0200 Organization: Jacob's private Usenet server Message-ID: References: <0hj5339mjmond132qhbn2o01unurs61lbj@4ax.com> <1178091967.392381.282510@o5g2000hsb.googlegroups.com> <5dv3wh6scrh1.2986pbvdw8y2$.dlg@40tude.net> NNTP-Posting-Host: taasingegade.news.jacob-sparre.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: jacob-sparre.dk 1178270187 28861 85.82.239.166 (4 May 2007 09:16:27 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 4 May 2007 09:16:27 +0000 (UTC) User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:iW/3mjRwFEDGV3JoZo45SVqLN4M= Xref: g2news1.google.com comp.lang.ada:15504 Date: 2007-05-04T11:16:24+02:00 List-Id: Dmitry A. Kazakov wrote: > On Fri, 04 May 2007 08:53:59 +0200, Jacob Sparre Andersen wrote: >> for Lines in 1 .. 10 loop >> Last := Index (Source => Text (Text'First .. Last - 1), > > Did you check if GNAT did not copy the string slice before calling to > Index? No. Do you have any suggestion for a way to check it. The reference manual (section 6.2) seems to indicate that it is up to the compiler to decide. Greetings, Jacob -- Beware of people with Gnus, they may Hurd you.