GMP 5.1.1 make check fail on Solaris 11

Marc Glisse marc.glisse at inria.fr
Sun Feb 17 18:46:36 CET 2013


On Sun, 17 Feb 2013, Torbjorn Granlund wrote:

> Marc Glisse <marc.glisse at inria.fr> writes:
>
>  On Sun, 17 Feb 2013, ken mays wrote:
>
>  > 1. patched gmp-5.1.1/tests/cxx/t-ops2.cc, change #include <cmath> to
>  > #include <math.h>
>
>  Ah, the issue wasn't about linking but about declarations (it helps if
>  you can show the exact error messages and your patches instead of
>  descriptions so we don't misinterpret your emails). Well, the -lm I
>  added shouldn't hurt. Now I see: floor was in C89, but trunc is C99
>  and thus wasn't in C++98, so Solaris' strict cmath header doesn't
>  provide it. I'll switch to math.h.
> 
> Perhaps this is not relevant: we don't yet require C99.

Switching to math.h seems like a good idea anyway. I don't know if any 
systems (even non-c99 ones) are missing trunc in math.h. If we want the 
test to pass on those, I could protect these few lines by #if 
__cplusplus>=201103L. That sounds like a safe solution to me. An 
alternative could be to have a small inline function my_trunc in the test 
that re-implements trunc. Or mix both solutions.

Any preference?

-- 
Marc Glisse


More information about the gmp-bugs mailing list