4 ms·
The one that got me is this: uint32_t foo = 1; foo <<= 32; Here, I figured that foo would always be 0. Wrong. It was always 0 with GCC, but this is undefined
by strenholme 7y ago
The one that got me is this:
uint32_t foo = 1;
foo <<= 32;
Here, I figured that foo would always be 0. Wrong. It was always 0 with GCC, but this is undefined in the spec and code like this can have a different value in clang. I actually had to make a security update to my little open source project because of this (although the code I wrote did not manifest the bug in an insecure way, even with clang).