> Ian Lance Taylor wrote:
> ...
> I don't personally see that as the question.  This code is
> undefined, and, therefore, is in some sense not C.  If we take
> any other attitude, then we will be defining and supporting
> a different language.  I think that relatively few people want
> the language "C plus signed integers wrap", which is the language
> we support with the -fwrapv option.
> ...

No, all such code is perfectly legal C and specified to have undefined
semantics in the instance of signed overflow; which seems clear from the
excerpts noted by Gabriel <http://gcc.gnu.org/ml/gcc/2006-12/msg00763.html>
may be specified by an implementation to assume whatever behavior desired.

Thereby full liberty in given to the implementers of the compiler to
apply whatever semantics are deemed most desirable; regardless of their
practical utility, or historical compatibility.  Ultimately the issue is
to what degree should optimizations preserve semantics otherwise expressed
and/or historically expected in their absents; and how should they when
deemed desired be invoked (i.e. by named exception or default at -Ox).


Reply via email to