Le vendredi 30 mai 2014 23:21:49 UTC+2, Cactus a écrit : > > On 30/05/2014 21:27, leif wrote: > > >> Error1error C4146: unary minus operator applied to unsigned type, > result > >> still unsigned > >> C:\Program Files (x86)\Microsoft Visual Studio > >> 12.0\VC\include\mpirxx.h1181GBP1 > > > > Line 118 really looks a bit weird; the minus should IMHO precede 'l': > > If you are suggesting that the line: > > __mpz_set_ui_safe(p, -static_cast<mpir_ui>(l)); > > would be better expressed as: > > __mpz_set_ui_safe(p, static_cast<mpir_ui>(-l)); > > I can only agree with you and plead guilty for introducing this weirdness. >
Please look at the history before making such changes. There is a reason why I wrote it this way, computing -LONG_MIN is undefined behavior while the corresponding unsigned operation is perfectly well defined, whatever the silly warning says. -- You received this message because you are subscribed to the Google Groups "mpir-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to mpir-devel+unsubscr...@googlegroups.com. To post to this group, send email to mpir-devel@googlegroups.com. Visit this group at http://groups.google.com/group/mpir-devel. For more options, visit https://groups.google.com/d/optout.