PASS: t-get_d
PASS: t-get_d_2exp
PASS: t-get_si
PASS: t-get_sx
[1] Abort trap (core dumped) "${tst}" >t-get_...
FAIL: t-get_ux
PASS: t-hamdist
PASS: t-import
PASS: t-inp_str
PASS: t-io_raw
PASS: t-jac
PASS: t-lcm
PASS: t-likely_prime_p
we do get these warning when building the tests
ibtool: link: cc -std=gnu99 -O2 -m64 -march=nocona -mtune=nocona -o .libs/t-
get_si t-get_si.o ../../tests/.libs/libtests.a
/home/jasonmoxham/gcc70.fsffrance.org.06942a/gcc70.fsffrance.org.17184a/mpirbld/.libs/libmpir.so
../../.libs/libmpir.so -Wl,-rpath -Wl,/home/jason
moxham/gcc70.fsffrance.org.06942a/gcc70.fsffrance.org.17184a/install/lib
cc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../../../mpir-2.4.0/tests/mpz -I../.. -
I../../../../mpir-2.4.0 -I../../../../mpir-2.4.0/tests -O2 -m64 -
march=nocona -mtune=nocona -c ../../../../mpir-2.4.0/tests/mpz/t-get_sx.c
../../../../mpir-2.4.0/tests/mpz/t-get_sx.c: In function 'check_data':
../../../../mpir-2.4.0/tests/mpz/t-get_sx.c:63: warning: implicit declaration
of function 'mpz_get_sx'
../../../../mpir-2.4.0/tests/mpz/t-get_sx.c: In function 'check_max':
../../../../mpir-2.4.0/tests/mpz/t-get_sx.c:102: warning: implicit declaration
of function 'mpz_set_sx'
/bin/ksh ../../libtool --tag=CC --mode=link cc -std=gnu99 -O2 -m64 -
march=nocona -mtune=nocona -o t-get_sx t-get_sx.o ../../tests/libtests.la
../../libmpir.la
libtool: link: cc -std=gnu99 -O2 -m64 -march=nocona -mtune=nocona -o .libs/t-
get_sx t-get_sx.o ../../tests/.libs/libtests.a
/home/jasonmoxham/gcc70.fsffrance.org.06942a/gcc70.fsffrance.org.17184a/mpirbld/.libs/libmpir.so
../../.libs/libmpir.so -Wl,-rpath -Wl,/home/jason
moxham/gcc70.fsffrance.org.06942a/gcc70.fsffrance.org.17184a/install/lib
cc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../../../mpir-2.4.0/tests/mpz -I../.. -
I../../../../mpir-2.4.0 -I../../../../mpir-2.4.0/tests -O2 -m64 -
march=nocona -mtune=nocona -c ../../../../mpir-2.4.0/tests/mpz/t-get_ux.c
../../../../mpir-2.4.0/tests/mpz/t-get_ux.c: In function 'check_data':
../../../../mpir-2.4.0/tests/mpz/t-get_ux.c:64: warning: implicit declaration
of function 'mpz_set_ux'
../../../../mpir-2.4.0/tests/mpz/t-get_ux.c:65: warning: implicit declaration
of function 'mpz_get_ux'
/bin/ksh ../../libtool --tag=CC --mode=link cc -std=gnu99 -O2 -m64 -
march=nocona -mtune=nocona -o t-get_ux t-get_ux.o ../../tests/libtests.la
../../libmpir.la
the log is
-bash-4.1$ cat t-get_ux.log
FAIL: t-get_ux (exit: 134)
==========================
mpz_get_ux() failed for data on item 8
Jason
I think the error is that while t-get_sx.c has the constants postfixed by an
"L" in the t-get_ux.c we dont. However the constants go up to 64bit so an L
would break windows . What we need is the postfix for an intmax_t , I think we
can use CNST_LIMB(0xfffffffff...) as it should be an L on unix and LL on
windows
Jason
look at the code I dont see what you trying to do
mpz_set_ux(z, val[i]);
n = mpz_get_ux(z);
#if NLIMBS == 1
if(n && n != z->_mp_d[k++]) // THIS SHOULD BE 0 NOT k++ ???????????
{
and
if(z->_mp_size != k) // THIS SHOULD BE 1 NOT k ??????????????????
{
printf("mpz_get_ux() failed for length on item %d (mpz size: %d,
size: %d)\n", i, z->_mp_size, k);
abort();
}
if(z->_mp_alloc < k) // THIS SHOULD BE 1 NOT K ??????????????
{
printf("mpz_get_ux() failed for allocation on item %d (mpz alloc:
%d, size: %d)\n", i, z->_mp_alloc, k);
abort();
}
I cant see how this passed on any other machine ??
Jason
my dinner was burning , looking at the code
> look at the code I dont see what you trying to do
>
>
> mpz_set_ux(z, val[i]);
> n = mpz_get_ux(z);
> #if NLIMBS == 1
> if(n && n != z->_mp_d[k++]) // THIS SHOULD BE 0 NOT k++
> ??????????? {
>
> and
>
>
> if(z->_mp_size != k) // THIS SHOULD BE 1 NOT k ??????????????????
> {
> printf("mpz_get_ux() failed for length on item %d (mpz size:
> %d, size: %d)\n", i, z->_mp_size, k);
> abort();
> }
> if(z->_mp_alloc < k) // THIS SHOULD BE 1 NOT K ??????????????
> {
> printf("mpz_get_ux() failed for allocation on item %d (mpz
> alloc: %d, size: %d)\n", i, z->_mp_alloc, k);
> abort();
> }
>
>
>
> I cant see how this passed on any other machine ??
> Jason
it looks like the ifdef I put in for VS2008 uintmax_t are wrong well
Jason
I get it now , the line
uintmax_t k = 0, n;
got me confused , because it's a declaration I couldn't see that k gets set to
0 on every loop , DUH...
The error is a compiler bug , mpz_set_ux(z,0xFFFFFFFF) does the right thing
but n=mpz_get_ux(z) returns 0xFFFFFFFFFFFFFFFF so the line
return (uintmax_t)(z->_mp_size ? z->_mp_d[0] : 0);
is compiled wrong
I'll set up a test so we reject this compiler
Jason
We cant set up the test as the compiler tests are done before we know we have
stdint.h , so the test would also fail on any system without stdint , we could
require that on unix like systems we require stdint.h and inttypes.h (which
came in with the C99 standard)
Jason