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,6c7dea22b75ba442 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.germany.com!news.banetele.no!news.hacking.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: ada compiler? Date: Fri, 16 Nov 2007 19:18:27 -0600 Organization: Jacob's private Usenet server Message-ID: References: <1194747665.6151.31.camel@K72> <_evZi.177931$Xa3.50640@attbi_s22> <87hcjq46t4.fsf@ludovic-brenta.org> <473abc9d$0$13104$9b4e6d93@newsspool2.arcor-online.net> <1195035988.599522.87580@50g2000hsm.googlegroups.com> <1195043147.1007.263.camel@kartoffel> <1195052954.315227.220840@o3g2000hsb.googlegroups.com> <1195056238.1007.317.camel@kartoffel> <1195058211.682783.288340@d55g2000hsg.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1195262090 31483 69.95.181.76 (17 Nov 2007 01:14:50 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 17 Nov 2007 01:14:50 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:18450 Date: 2007-11-16T19:18:27-06:00 List-Id: "Ludovic Brenta" wrote in message news:1195058211.682783.288340@d55g2000hsg.googlegroups.com... > Georg Bauhaus wrote: > > On Wed, 2007-11-14 at 07:09 -0800, Ludovic Brenta wrote: > > > But if the stack is exhausted or nearly so (perhaps because the last > > > in a long series of recursive calls raises Storage_Error), chances are > > > high that the exception handler itself will overflow the stack (e.g. > > > passing your string "Hey! You!" to a procedure might itself cause a > > > stack overflow). This, in my view, greatly reduces the benefit of the > > > exception. Also, what if raising the exception requires some stack > > > space? Maybe I should have said that explicitly. > > > > No, these are matters of course, and they are mentioned in the RM. > > Not really. 11.5(23) says that a stack overflow raises Storage_Error > but, since the stack has overflowed, I'm not convinced that the > exception can still be raised, propagated and handled properly. The RM > is silent about that part and I believe this is an implementation > issue. True enough, but an implementation that couldn't raise and handle Storage_Error (without any further operations in the handler) would fail the ACATS (yes, this is tested, and has been all the way back to Ada 83). One possible reaction is to unwind the broken recursion by putting the handler outside of the recursive call. In this case, one would expect to have no trouble handling the exception as much of the stack memory has been freed before the handler is entered. I think anyone who did that would be on the phone to their vendor in a hurry if that did not work (and yes, I've been on the receiving end of such calls). Formally, *anything* (including "null;") in an Ada program can raise Storage_Error. But implementations generally take precautions to ensure that it works as expected, because having the bare minimum implementation is rarely enough in the real world. Randy.