Using MPZ_ROINIT_N in mpz sources

Niels Möller nisse at
Sun Nov 27 09:30:17 UTC 2016

"Marco Bodrato" <bodrato at> writes:

> I do not remember if we require C99 to compile the library...
> Can we use MPZ_ROINIT_N inside our sources to improve readability? e.g.

For what it's worth, IIRC the non-constant initializer used by
MPZ_ROINIT_N has been supported by gcc more or less forever, at least
since 2.3 from the mid 1990s. And it would make some sense to me to
require c99 or gcc.

> Moreover, can we slightly abuse it to obtain a static lazy init w/out
> calling the _init function? E.g.

If we want to do that, I think we should have a separate macro for the
initializer (and preferably point to some shared read-only limb). Or
make mpz_init inline?


Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.

More information about the gmp-devel mailing list