> 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 ...
}
Mostly new compilers now a days do handle such behavior with a compiler error or warning. 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. In fact instead of throwing a warning it can wipe your complete hardware and that too is allowed according to the C standard...
In contrast there is implementation defined behavior, and unspecified behavior. Where the compiler developers have to document and take care of certain things.
I wrote a detailed article about the subtle difference you can check that out....
https://medium.com/@faizan10114/understanding-c-terminologie...