On Fri, Mar 18, 2016 at 10:29 AM, Igor Schein <igorschein@gmail.com> wrote:
On Fri, Mar 18, 2016 at 10:26 AM, Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> wrote:
On Wed, Mar 16, 2016 at 06:17:24PM -0400, Igor Schein wrote:
> Nevertheless, when I use flag -std=c++03 to comply with the old standard,
> there's no issue compiling buch1.c.

If the standard allow the compiler to read header files we did not ask
for, then we are stuck.

> There's a similar problem further up in the build process when using C++03:
>
> $ /opt/solarisstudio12.4/bin/CC  -c -I. -I../src/headers -KPIC -fast
> -fsimple=1  -erroff -std=c++03 -o Hensel.o ../src/basemath/Hensel.c
> "../src/basemath/Hensel.c", line 869: 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*))".
> 1 Error(s) detected.

This is unrelated. I am surprised there not more like this.

Cheers,
Bill.

There're actually more like that, I just gave one as an example. Any chance of fixing it?

Thanks,

Igor

Actually, this one is more pressing - happens with the stock g++ compiler:

g++  -c -I. -I../src/headers -fPIC -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -o arith1.o ../src/basemath/arith1.c
../src/basemath/arith1.c: In function ‘long int* qfi_Shanks(GEN, GEN, long int)’:
../src/basemath/arith1.c:4591:16: error: call of overloaded ‘sqrt(long int&)’ is ambiguous
   rt_n = sqrt(n);
                ^
../src/basemath/arith1.c:4591:16: note: candidates are:
In file included from /usr/include/math.h:12:0,
                 from ../src/headers/pari.h:34,
                 from ../src/basemath/arith1.c:20:
/usr/include/iso/math_iso.h:203:21: note: long double std::sqrt(long double)
  inline long double sqrt(long double __X) { return __sqrtl(__X); }
                     ^
/usr/include/iso/math_iso.h:171:15: note: float std::sqrt(float)
  inline float sqrt(float __X) { return __sqrtf(__X); }
               ^
/usr/include/iso/math_iso.h:65:15: note: double std::sqrt(double)
 extern double sqrt __P((double));
               ^
*** Error code 1
make: Fatal error: Command failed for target `arith1.o'

Thanks,

Igor