Warning when using gmp 64 bits in vcpkg

Torbjörn Granlund tg at gmplib.org
Sun Feb 28 20:46:36 UTC 2021


Cristofer Martins <CristoferMartins at hotmail.com> writes:

  The warning is as follows(MSVC) "warning C4146: unary minus operator
  applied to unsigned type, result still unsigned"
  Line 2240 inside gmp.h code "*__gmp_rp = (- *__gmp_up) & GMP_NUMB_MASK;"
  I hope its fixed since its create warnings for all files that includes gmp.h

No this is not "fixed" in GMP.  Negation is completely well-defined for
unsigned types.  If some compiler warns about negation, use a better
compiler, or else try to disable this bogus warning.

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-bugs mailing list