On 07/26/2013 01:33 AM, Andrew Pinski wrote:
What does it mean by "unsigned-integer-overflow"? Unsigned integers never overflow.
This is a common misconception. Conversion to an unsigned integer type never has undefined behavior, but unsigned integer arithmetic does. C11 says,
If an exceptional condition occurs during the evaluation of an expression (that is, if the result is not mathematically defined or not in the range of representable values for its type), the behavior is undefined.
So UINT_MAX+1U has undefined behavior. Jason