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 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.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: hreba Newsgroups: comp.lang.ada Subject: Re: Interfaces.C + generics: stack overflow Date: Fri, 24 Mar 2017 13:20:49 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net b5S3NG09HtOzU3fbTxDCsQ3hB07sxPuG+aEgAd918XPXqwcB2s Cancel-Lock: sha1:Ep/PC/qSSeV32aRfZRBA8zHI6SM= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:46446 Date: 2017-03-24T13:20:49+01:00 List-Id: On 03/23/2017 06:45 PM, Jeffrey R. Carter wrote: > 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. > Did as you suggested. Clearly better. Unfortunately the stack overflow persists. For the complete code please see my answer to Randy. -- Frank Hrebabetzky +49 / 6355 / 989 5070