3 ms·
> So if you try to do an out of bound shift a new compiler might throw a warning, but according to the C standard it does not have to. Right, for doing so need
by dom0 9y ago
> So if you try to do an out of bound shift a new compiler might throw a warning, but according to the C standard it does not have to.
Right, for doing so needs to determine that this is happening, which neither GCC and Clang can do for fairly trivial cases like
for (i = 0; i < 100; i ++) {
... x << i ...
}
- fazkan 9y agoYes they don't, I assumed they would, but they dont. I just wanted to emphasize the fact that they don't have to. Perhaps an unbound shift was a wrong example.. thanks for catching that...