GMP 6.1.0 release candidate available
Niels Möller
nisse at lysator.liu.se
Sat Oct 31 14:45:55 UTC 2015
tg at gmplib.org (Torbjörn Granlund) writes:
> nisse at lysator.liu.se (Niels Möller) writes:
>
> For the the case of writing tests , the rrandomb-style funtions are very
> useful, but my gut feeling is still that they don't belong in mini-gmp.
>
> Cannot GMP be used for generating test values for mini-gmp?
That's what the current mini-gmp tests do. There's one compilation unit
which includes gmp.h (and not mini-gmp.h), with various helper functions
which call gmp and convert all bignum inputs and outputs to and from hex
strings.
> One would need to be careful when linking things so that mini-gmp
> functions are preferred. This,
>
> gcc test.c minigmp.a libgmp.a
>
> should work correctly since the linker works left-to-right when
> resolving symbols.
To the linker, the symbols are completely distinct in gmp and mini-gmp,
since mini-gmp doesn't do any name-mangling. The tricky thing is that we
have two possibly incompatible definitions of the type mpz_t. That's why
each compilation unit in the mini-gmp tests includes either gmp.h or
mini-gmp.h but never both.
Regards,
/Niels
--
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.
More information about the gmp-bugs
mailing list