GMP prototypes

Zimmermann Paul Paul.Zimmermann at
Tue Jul 2 08:01:35 CEST 2013


Steve Kargl raised an issue on the MPFR list about different prototypes in
the documentation and mpfr.h:

Since we copied the good ideas from GMP, the same problem happens here:

   -- Function: void mpz_add (mpz_t ROP, mpz_t OP1, mpz_t OP2)

   __GMP_DECLSPEC void mpz_add __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));

thus if one defines a function which can take mpz_add() as argument, one
should write:

   int foo (void (*)(mpz_t, const mpz_t, const mpz_t))

which is not clear from the documentation.

What would be a proper solution?

Paul Zimmermann

More information about the gmp-discuss mailing list