On Mon, Mar 28, 2016 at 10:43 AM, Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> wrote:
On Mon, Mar 28, 2016 at 09:03:04AM -0400, Igor Schein wrote:
> I am not sure what you mean by "reproduce".  The errors are clearly
> Solaris-specific.

Yes, but it is unclear why they chould be specific to Solaris.

> I built g++-5.3 on Solaris, and the errors still occur.  Here's the latest
> (shorter than before) list of compilation errors:

Yes, I tried to fix lots of errors.

> ../src/basemath/base2.c:663:17: error: expected unqualified-id before
> numeric constant
> ../src/basemath/base2.c:665:29: error: invalid conversion from ‘int’ to
> ‘GEN {aka long int*}’ [-fpermissive]
> ../src/basemath/base2.c:669:42: error: invalid conversion from ‘int’ to
> ‘GEN {aka long int*}’ [-fpermissive]

I wonder. Can you check whether 'ERR' is defined on this plateform ?

This is line 663 to 669:

   GEN N, u, ERR = pari_err_last();
   long l;
   switch(err_get_num(ERR))
   {
     case e_INV:
     {
       GEN p, x = err_get_compo(ERR, 2);

Maybe renaming ERR to something else fix the problem.

Cheers,
Bill.

You're correct:

$ grep -wn ERR /usr/include/sys/regset.h
80:#define      ERR             13

Same goes for the other error:

$ make gp
g++  -c -I. -I../src/headers -fPIC -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -o arith2.o ../src/basemath/arith2.c
In file included from /usr/include/sys/ucontext.h:14:0,
                 from /usr/include/sys/signal.h:212,
                 from /usr/include/sys/procset.h:17,
                 from /usr/include/sys/wait.h:19,
                 from /usr/include/stdlib.h:15,
                 from ../src/headers/pari.h:18,
                 from ../src/basemath/arith2.c:20:
../src/basemath/arith2.c:1502:14: error: expected unqualified-id before numeric constant
 static ulong DS[] ={
              ^
../src/basemath/arith2.c: In function ‘pari_ulong sumdigitsu(pari_ulong)’:
../src/basemath/arith2.c:1547:31: error: invalid types ‘int[long unsigned int]’ for array subscript
   while (n) { s += DS[n % 1000]; n /= 1000; }
$ grep -nw DS /usr/include/sys/regset.h
90:#define      DS              3

Renaming should work.

Thanks,

Igor