News for hackers. Stuff that matters.
Re:Undefined Behavior in 2017 by dom0 on Wednesday July 05, 2017 @04:26AM (#14700740)
> 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 ...
    }
Re:Undefined Behavior in 2017 by fazkan on Thursday July 06, 2017 @04:21AM (#14708892)
Yes 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...