Hi! Please, do not top-post. On Sun, Feb 19, 2017 at 04:58:48PM +0100, Niklas Gürtler wrote: > Your "id" variable is signed, and right-shifting signed integers yields > implementation-defined behaviour according to the C Standard, Only right-shifting *negative* numbers is implementation defined. GCC defines it the obvious way (for two's complement). But yes, unsigned types would give much less headache here. Segher