Bill Allombert on Wed, 17 Sep 2014 15:43:55 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Detecting whether PARI has been initialized

On Wed, Sep 17, 2014 at 02:09:24PM +0200, Jeroen Demeyer wrote:
> Dear pari-dev,
> what is the recommended way to detect whether or not pari_init() has
> already been called? This is useful for libraries which might
> interact which other libraries which have initialized PARI.

I would say it is not recommended.

> John Cremona's eclib for example does
>   if (!bot) {
>     pari_init(1000000, 1000000);
>   }
> which doesn't work anymore with the latest master.

It did not work before either: if 
the user did
before calling eclib,
the test would fail.

The only reason the test seemed worked is that unitialized global variables like
bot are initialized by 0 by the runtime.