Re: unused macro MPN_PTR_SWAP in mini-gmp.c

2022-03-27 Thread Paul Eggert
On 3/19/22 04:44, Niels Möller wrote: Paul Eggert writes: In libgmp 6.2.1, mini-gmp.c defines a macro without using it, causing the command "gcc -Wunused-macros -Werror" to fail with the following diagnostic: I haven't used -Wunused-macros before, I take it it warns only about macros

Re: unused macro MPN_PTR_SWAP in mini-gmp.c

2022-03-20 Thread Marco Bodrato
Ciao Paul, Il 2022-03-18 00:37 Paul Eggert ha scritto: On 3/17/22 11:32, Marco Bodrato wrote: -  MP_SIZE_T_SWAP (u->_mp_alloc, v->_mp_alloc); -  MP_PTR_SWAP (u->_mp_d, v->_mp_d); +  MPN_PTR_SWAP (u->_mp_d, u->_mp_alloc, v->_mp_d, v->_mp_alloc); Thank you, this looks good. Slightly changed

Re: unused macro MPN_PTR_SWAP in mini-gmp.c

2022-03-19 Thread Niels Möller
Paul Eggert writes: > In libgmp 6.2.1, mini-gmp.c defines a macro without using it, causing > the command "gcc -Wunused-macros -Werror" to fail with the following > diagnostic: I haven't used -Wunused-macros before, I take it it warns only about macros defined in .c files? Since it's perfectly

Re: unused macro MPN_PTR_SWAP in mini-gmp.c

2022-03-19 Thread Paul Eggert
On 3/17/22 11:32, Marco Bodrato wrote:  mpz_swap (mpz_t u, mpz_t v)  {    MP_SIZE_T_SWAP (u->_mp_size, v->_mp_size); -  MP_SIZE_T_SWAP (u->_mp_alloc, v->_mp_alloc); -  MP_PTR_SWAP (u->_mp_d, v->_mp_d); +  MPN_PTR_SWAP (u->_mp_d, u->_mp_alloc, v->_mp_d, v->_mp_alloc); Thank you, this looks

Re: unused macro MPN_PTR_SWAP in mini-gmp.c

2022-03-17 Thread Marco Bodrato
Ciao Paul, Il 2022-03-09 02:56 Paul Eggert ha scritto: In libgmp 6.2.1, mini-gmp.c defines a macro without using it, causing Thanks for spotting this! Proposed patch attached. There is also a different possible way to heal the problem: using it :-D diff -r a44f487c8d20

unused macro MPN_PTR_SWAP in mini-gmp.c

2022-03-17 Thread Paul Eggert
In libgmp 6.2.1, mini-gmp.c defines a macro without using it, causing the command "gcc -Wunused-macros -Werror" to fail with the following diagnostic: lib/mini-gmp.c:251: warning: macro "MPN_PTR_SWAP" is not used [-Wunused-macros] 251 | #define MPN_PTR_SWAP(xp,xs, yp,ys) \ |