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.107.53.207 with SMTP id k76mr6595030ioo.36.1490567663433; Sun, 26 Mar 2017 15:34:23 -0700 (PDT) X-Received: by 10.157.68.202 with SMTP id p10mr1531465otg.19.1490567663407; Sun, 26 Mar 2017 15:34:23 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!y18no124060itc.0!news-out.google.com!i72ni3646itb.0!nntp.google.com!y18no124049itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 26 Mar 2017 15:34:23 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8303:2100:5985:2c17:9409:aa9c; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8303:2100:5985:2c17:9409:aa9c References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <39ada48a-1faf-49fd-a97d-8544269de8e7@googlegroups.com> Subject: Re: Interfaces.C + generics: stack overflow From: Robert Eachus Injection-Date: Sun, 26 Mar 2017 22:34:23 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:46479 Date: 2017-03-26T15:34:23-07:00 List-Id: On Saturday, March 25, 2017 at 11:21:41 AM UTC-4, hreba wrote: > It works finally, I just don't know the reason. All I did is take=20 > Dmitrys suggestion, and move the package instantiation from the main=20 > program to package Integ_Aux (that is where the function to be passed to= =20 > the C-library-integrator is defined.) I'm glad you found a solution. Dave Emery used to call Storage_Error a par= achute that opened on impact. (Think Roadrunner cartoons.) Things have got= ten a lot better, and GNAT in particular tries to identify all cases where = Storage_Error will always be raised (as warnings). But the real issue is t= hat it is in general not possible to create a stack frame or allocate an ob= ject after an occurrence of Storage_Error. It would be nice if there was a parameter which identified where in that pa= rticular compiler the Storage_Error came from. Yes, Storage_Error is raise= d during execution, but the generated code or sometimes even the run-time l= ibrary code has no clue you can use during debugging. I wonder how much co= uld be done with Exception_Message. If the compiler had a collection of st= rings to be returned, there would be no need to allocate space for a string= after the Storage_Error..