In C, when a prototype ends with an ellipsis, the types of the corresponding arguments cannot be checked. Thus you need to make sure that the type of the last argument is correct. Here, since mpz_inits
expects pointers to mpz_ptr
, you need to provide a null pointer to this type, e.g. by using a cast:
mpz_inits (a, b, c, (mpz_ptr) 0);
or
mpz_inits (a, b, c, (mpz_ptr) NULL);
Note that casting to another pointer type such as void *
is not guaranteed to work on all platforms, in particular if the sizes of the pointer types are different. Now, whether such platforms exist / GMP supports such platforms is another problem... But other issues could also come from advanced compiler optimizations. So, it is better to strictly follow the C standard here.