GMP prototypes

Torbjorn Granlund tg at gmplib.org
Tue Jul 16 14:56:26 CEST 2013


Zimmermann Paul <Paul.Zimmermann at inria.fr> writes:

  Steve Kargl raised an issue on the MPFR list about different prototypes in
  the documentation and mpfr.h:
  
     https://sympa.inria.fr/sympa/arc/mpfr/2013-07/msg00002.html
  
  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?
  
This is a long-standing bug in the documentation.
We need to add lots of 'const' to it.

-- 
Torbjörn


More information about the gmp-discuss mailing list