Bill Allombert on Tue, 10 Sep 2002 15:58:53 +0200

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

Re: gnil

On Tue, Sep 10, 2002 at 03:42:47PM +0200, Karim BELABAS wrote:
> On Tue, 10 Sep 2002, Bill Allombert wrote:
> > The magic gnil object is static in GP.
> No. It is global in the library.
src/language/init.c read
/*      Variables statiques communes :         */
FILE    *pari_outfile, *errfile, *logfile, *infile;
GEN     *polun, *polx;
GEN     gnil, gzero, gun, gdeux, ghalf, polvar, gi;
GEN     gpi=NULL, geuler=NULL, bernzone=NULL;

which lead me to believed it was static.

I suppose we need to fix paricom.h ?

> What's wrong with
> GEN f(GEN x) { return gcmp0(x)? gnil: gun; }

yellowpig% cat >test.c <<EOF
GEN f(GEN x) { return gcmp0(x)? gnil: gun; }
yellowpig% gcc test.c
test.c: In function `f':
test.c:2: `gnil' undeclared (first use in this function)
test.c:2: (Each undeclared identifier is reported only once
test.c:2: for each function it appears in.)