GMP 6.1.0 release candidate available

Niels Möller nisse at
Sat Oct 31 14:45:55 UTC 2015

tg at (Torbjörn Granlund) writes:

> nisse at (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

> 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.


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