Help stabilising mini-gmp

Torbjörn Granlund tg at gmplib.org
Fri Nov 25 16:17:39 UTC 2016


Marc Glisse <marc.glisse at inria.fr> writes:

  Fixed. It was unhappy about (-13) << 2. I am a bit surprised it
  doesn't complain about (-13) >> 2 on the next line, we'll see if it
  ever becomes an issue.

This must be a compiler problem.  At least in C, shifting negative
integers is undefined.  It is a pity that it is, but the standard say
so.

I am less sure about C++.  Some googling did not provide a definitive
answer.

But if left shift of negative integers is undefined, surely right shift
is too!

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


More information about the gmp-devel mailing list