mini-gmp warnings

Vincent Lefevre vincent at
Sun Apr 26 20:04:08 UTC 2020

On 2020-04-26 14:31:21 +0200, Niels Möller wrote:
> I'm updating the copy of mini-gmp I use in nettle to the latest version.
> In Nettle, it's compiled with gcc -Wall, and I some new warnings, like
> /home/nisse/hack/nettle/mini-gmp.c: In function ‘mpn_common_scan’:
> /home/nisse/hack/nettle/mini-gmp.c:99:23: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
>                        ^

I've found that -Wsign-compare is useless in practice, until

is fixed. Adding casts or changing types to unsigned could in some
cases add or hide real bugs.

FYI, this bug and bug 4210 are referenced in MPFR's mpfr.h, where it
is important not to trigger warnings as they would hit 3rd-party code.

Vincent Lefèvre <vincent at> - Web: <>
100% accessible validated (X)HTML - Blog: <>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

More information about the gmp-devel mailing list