Chris Lattner wrote:

C99 says:

The integer promotions are performed on each of the operands. The type of the result is that of the promoted left operand. If the value of the right operand is negative or is greater than or equal to the width of the promoted left operand, the behavior is undefined.

Thus, it is undefined.

So the suggested transformation is indeed valid, which is what I
thought, but some seem to be contesting this, though I don't see
on what grounds.

Reply via email to