You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shifting by more than sizeof(x) * 8 is undefined behaviour in C - moreover, the conversions between int and uint here are quite wonky.
Nim can either flag the behaviour or do min(sizeof(x) * 8, shift) which is probably what is intended for large shifts
nim 1.6.6
The text was updated successfully, but these errors were encountered:
Nim can either flag the behaviour or do min(sizeof(x) * 8, shift) which is probably what is intended for large shifts
it probably makes more sense to mask shifts (shift and (sizeof(x)*8-1)) as pretty much all processor architectures do this (except for 32-bit ARM) and C compilers will just optimise the and away.
Shifting by more than
sizeof(x) * 8
is undefined behaviour in C - moreover, the conversions between int and uint here are quite wonky.Nim can either flag the behaviour or do
min(sizeof(x) * 8, shift)
which is probably what is intended for large shiftsnim 1.6.6
The text was updated successfully, but these errors were encountered: