On Mon, Mar 28, 2016 at 5:45 PM, Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> wrote:
On Mon, Mar 28, 2016 at 04:13:34PM -0400, Igor Schein wrote:
> On Mon, Mar 28, 2016 at 10:43 AM, Bill Allombert <
> $ 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.

Done thanks!
This is crazy...
<https://lists.x.org/archives/xorg-devel/2013-November/038808.html>

Cheers,
Bill.

Thanks.  Now it compiled cleanly with gcc-4.  Just one warning:

../src/basemath/dirichlet.c: In function ‘long int dirmuleuler_small(GEN, GEN, long int, pari_ulong, GEN)’:
../src/basemath/dirichlet.c:42:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (hiremainder || nj > b) continue;
                               ^

Then I tried compiling with Sun Studio's C++ compiler and got a bunch of errors:

"../src/kernel/gmp/mp.c", line 61: Error: Formal argument 1 of type extern "C" void*(*)(unsigned)* in call to __gmp_get_memory_functions(extern "C" void*(*)(unsigned)*, extern "C" void*(*)(void*,unsigned,unsigned)*, extern "C" void(*)(void*,unsigned)*) is being passed void*(*)(unsigned)*.
"../src/kernel/gmp/mp.c", line 61: Error: Formal argument 2 of type extern "C" void*(*)(void*,unsigned,unsigned)* in call to __gmp_get_memory_functions(extern "C" void*(*)(unsigned)*, extern "C" void*(*)(void*,unsigned,unsigned)*, extern "C" void(*)(void*,unsigned)*) is being passed void*(*)(void*,unsigned,unsigned)*.
"../src/kernel/gmp/mp.c", line 61: Error: Formal argument 3 of type extern "C" void(*)(void*,unsigned)* in call to __gmp_get_memory_functions(extern "C" void*(*)(unsigned)*, extern "C" void*(*)(void*,unsigned,unsigned)*, extern "C" void(*)(void*,unsigned)*) is being passed void(*)(void*,unsigned)*.
"../src/kernel/gmp/mp.c", line 71: Error: Formal argument 1 of type extern "C" void*(*)(unsigned)* in call to __gmp_get_memory_functions(extern "C" void*(*)(unsigned)*, extern "C" void*(*)(void*,unsigned,unsigned)*, extern "C" void(*)(void*,unsigned)*) is being passed void*(*)(unsigned)*.
"../src/kernel/gmp/mp.c", line 71: Error: Formal argument 2 of type extern "C" void*(*)(void*,unsigned,unsigned)* in call to __gmp_get_memory_functions(extern "C" void*(*)(unsigned)*, extern "C" void*(*)(void*,unsigned,unsigned)*, extern "C" void(*)(void*,unsigned)*) is being passed void*(*)(void*,unsigned,unsigned)*.
"../src/kernel/gmp/mp.c", line 71: Error: Formal argument 3 of type extern "C" void(*)(void*,unsigned)* in call to __gmp_get_memory_functions(extern "C" void*(*)(unsigned)*, extern "C" void*(*)(void*,unsigned,unsigned)*, extern "C" void(*)(void*,unsigned)*) is being passed void(*)(void*,unsigned)*.
"../src/basemath/Hensel.c", line 872: Error: Overloading ambiguity between "ZpX_ZpXQ_liftroot_ea(long*, long*, long*, long*, long, void*, extern "C" int(*)(void*,long*,long*))" and "ZpX_ZpXQ_liftroot_ea(long*, long*, long*, long*, long, void*, int(*)(void*,long*,long*))".
"../src/language/intnum.c", line 713: Error: Different types for "?:" (long*(long*) and extern "C" long*(long*)).
"../src/language/sumiter.c", line 157: Error: Different types for "?:" (extern "C" int(*)(long*,long*) and int(*)(long*,long*)).
"../src/language/init.c", line 2096: Error: Overloading ambiguity between "obj_checkbuild_prec(long*, long, extern "C" long*(*)(long*,long), extern "C" long(*)(long*), long)" and "obj_checkbuild_prec(long*, long, long*(*)(long*,long), long(*)(long*), long)".
"../src/language/init.c", line 2099: Error: Overloading ambiguity between "obj_checkbuild_prec(long*, long, extern "C" long*(*)(long*,long), extern "C" long(*)(long*), long)" and "obj_checkbuild_prec(long*, long, long*(*)(long*,long), long(*)(long*), long)".

Igor