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!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: generic provokes segmentation fault Date: Mon, 18 May 2020 22:16:20 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net dKKwnrHergrHmUGUhVGx5QMEnN4tdHVtnJfAxmaCSHv/sJtidh Cancel-Lock: sha1:YZx1kE9tCiuc+xdGpUjKo6g1d1g= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 In-Reply-To: Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:58738 Date: 2020-05-18T22:16:20+02:00 List-Id: On 2020-05-18 14:36, Dmitry A. Kazakov wrote: > What is global variables you are talking about? gsl_odeiv2_driver seems > to be allocated and initialized using library functions. Initially, I tried the following: - the library defines a type with that driver as a private component - the client declares a variable of that type - the client calls the library's initialization function, which instanciates this variable (and the driver within) I just was not able to get around that local/non-local object/pointer problem, and for now the driver is a global variable hidden in the library, initialized as a side effect of Init_Solve, as a workaround. This is unsatisfactory of course, because only 1 driver can be active at a time. Presently, I use flags to ensure initialization and to prevent multiple ones. In order not to mix topics, and to avoid posting lots of code here, I would like to come back on this later, with a minimal example. Regards, -- Frank Hrebabetzky, Kronach +49 / 9261 / 950 0565