http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50115

--- Comment #8 from Balint Szente <balint at szentedwg dot ro> 2011-08-18 
12:44:53 UTC ---
Just for the record, for clarifying this for me and other people... There are
two statements in C++ standard:

* Chapter 5
"If during the evaluation of an expression, the result is not mathematically
defined or not in the range of representable values for its type, the behavior
is undefined."
* Section 3.9.1
"... unsigned arithmetic does not overflow because a result that cannot be
represented by the resulting unsigned integer type is reduced modulo the number
that is one greater than the largest value that an be represented by the
resulting unsigned integer type."

So if I understand correctly *signed integer* overflow is undefined and
*unsigned integer* overflow actually wraps around. Is this correct?

Reply via email to