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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Interfaces.C + generics: stack overflow Date: Thu, 23 Mar 2017 18:45:36 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 23 Mar 2017 17:42:41 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="2ab0af1c25121eef027c7a53ef18725c"; logging-data="19909"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/x3qs+4BiB2PnOJLmvIxpMGFnOoVPyHZE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Cancel-Lock: sha1:B/styt/d8pH7x3tunRyvnNAKk8E= Xref: news.eternal-september.org comp.lang.ada:46443 Date: 2017-03-23T18:45:36+01:00 List-Id: On 03/23/2017 08:43 AM, hreba wrote: > > Now when pass the type real as a generic parameter: > > --------------------------------------------------------------------- > generic > type Real is digits <>; > package GSL is > ... > --------------------------------------------------------------------- > > and instanciate GSL with exactly the same type as above, I get a > STORAGE_ERROR : stack overflow or erroneous memory access. Where do you instantiate the package? Where do you declare the function you pass to Integration_QNG? > function gsl_integration_qng > (f: access GSL_Function; This should not need to be an access parameter. It should be passed by reference as an "in" parameter. You can make it "in out" if you want. -- Jeff Carter "My little plum, I am like Robin Hood. I take from the rich, and I give to the poor. ... Us poor." Poppy 96