In C, a left shift of a negative value is undefined behavior. I've encountered two libraries compiled with Intel's ICC where the offending code was removed. The same code was fine under Clang, Comeau, GCC and MSVC.
Does the standard make any mention of left shifting a negative value 0 places? Is it also undefined?
(The detail I'm curious about is a 0-sized shift, which is no shift at all in practice. So I'm wondering if the language is vague such that a 0-sized left shift may be allowed).
Excerpt from C99 with Technical corrigenda TC1, TC2, and TC3 included:
[...]
So, always undefined.