comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: How do functions return unbounded arrays?
Date: 1998/06/21
Date: 1998-06-21T00:00:00+00:00	[thread overview]
Message-ID: <dewar.898439463@merv> (raw)
In-Reply-To: 1998061518584100.OAA28557@ladder01.news.aol.com


John Herro said

<<That question I can answer definitely.  The following program raises
Storage_Error on my machine when compiled with Open Ada (an Ada 83 compiler).
The "with Text_IO;" is necessary with that compiler if the user is to see the
unhandled exception:

with Text_IO;
procedure Test is
   S : String(1 .. 18);
begin
   for L in Long_Integer range
        10_000_000 .. 99_999_998 loop
      S := Long_Integer'Image(L) &
           Long_Integer'Image(L + 1);
   end loop;
end Test;
>>


This seems a clear bug to me, it is a storage leak! It should be reported
to the vendor as a bug (if they still care about their Ada 83 compiler!)

No decent compiler should raise SE due to storage leaks for temporary
allocations in loops.

(i.e. no compiler should accept such a situation as other than a bug
that needs fixing. Certainly that is the attitude we take with GNAT,
and we have indeed fixed a number of bugs of this type over the years!)





      parent reply	other threads:[~1998-06-21  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-14  0:00 How do functions return unbounded arrays? Markus Kuhn
1998-06-14  0:00 ` Robert A Duff
1998-06-15  0:00 ` John Herro
1998-06-17  0:00   ` Matthew Heaney
1998-06-17  0:00   ` Mark D. McKinney
     [not found]   ` <35865075.9D7DCBD@cl.cam.ac.uk>
1998-06-17  0:00     ` Gavin Finnie
1998-06-17  0:00       ` Rod Chapman
1998-06-21  0:00         ` Robert Dewar
1998-06-21  0:00         ` Robert Dewar
1998-06-21  0:00       ` Robert Dewar
1998-06-17  0:00     ` Matthew Heaney
1998-06-21  0:00       ` Robert Dewar
1998-06-18  0:00     ` Mats Weber
1998-06-21  0:00       ` Robert Dewar
1998-06-21  0:00   ` Robert Dewar [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox