I am running GDB through a snippet of code which is doing a left shift of 1 by 10000.
Here is the code
uint32_t x = (1 << y )
The value of y is 10000.
I was expecting a value of 0 for x, but I see that x has a value of 65536. Quite strange.
GDb also shows this behavior
(gdb) p 1<<10000
$52 = 65536
(gdb) p 1<<9984
$54 = 1
What's wrong with this?