Re: clang warning about mini-gmp.c when used in Emacs

2022-04-18 Thread Paul Eggert
On 4/14/22 22:29, Niels Möller wrote: 1. Is the void cast really needed? Yes, I think so. Various compilers complain if a statement 'E;' has an expression E without side effects. The standard way to pacify them is to cast E to void. See, for example,

clang warning about mini-gmp.c when used in Emacs

2022-04-14 Thread Paul Eggert
Mattias Engdegård reported that the Emacs master source currently generates the following warning when Emacs is built with mini-gmp.c under Clang 13: In file included from /Users/mattias/emacs/lib/mini-gmp-gnulib.c:47: /Users/mattias/emacs/lib/mini-gmp.c:1138:2: warning: unused variable

gmp-bugs mail archive status?

2022-03-27 Thread Paul Eggert
While following up on my recent mini-gmp.c bug report I noticed that https://gmplib.org/list-archives/gmp-bugs/ stops in November 2021 so I couldn't give a URL to a recent message. Perhaps you've moved to a different mail archiver? or you've disabled archiving? Or you update the archive only

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 ab

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

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) \ |

GMP bootstrap fails with Autoconf 2.69d

2020-11-15 Thread Paul Eggert
Autoconf 2.70 is about to be released, and some people have been using prereleases to build lots of GNU packages. They've run into a problem with GMP, though, because GMP uses AC_INIT in a way contrary to the Autoconf manual, and changes in Autoconf mean that GMP's "./.bootstrap" procedure

mini-gmp mpz_out_str dereferences null pointer with out-of-range base

2020-07-09 Thread Paul Eggert
The mpz_out_str implementation in mini-gmp.c computes strlen (NULL) if its base argument is out of range. This causes GCC 10.1 -fanalyzer to complain: mini-gmp.c:4428:9: error: use of NULL 'str' where non-null expected [CWE-690] [-Wanalyzer-null-argument] Proposed patch attached. This patch

whitespace and grammar fixes for mini-gmp.c

2020-01-27 Thread Paul Eggert
When merging GNU MP 6.2.0 mini-gmp.c into GNU Emacs (which uses mini-gmp on platforms lacking libgmp), I noticed three trivial fixes that had been applied on the Emacs copy that would be useful to propagate upstream to GNU MP. The first is trailing whitespace on a source code line (which the