[ub] A proposal to define signed overflow submitted?

David Vandevoorde daveed at edg.com
Fri Feb 16 00:44:31 CET 2018



> On Feb 15, 2018, at 5:14 PM, Myria <myriachan at gmail.com> wrote:
> 
> I don't know whether anyone saw this, but apparently, there is a
> proposal to make signed integers use two's complement and to make
> overflow well-defined as wrapping:
> 
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0907r0.html
> 
> I don't know whether this person's proposal made it for the
> Jacksonville mailing, though.
> 
> Removing ones'-complement and sign-magnitude representations is far
> less controversial than defining signed overflow as wrapping.
> 
> I'm personally on the side of defining signed overflow as wrapping,
> but compiler people do have a point that it would inhibit
> optimizations in certain cases involving signed integers.

My understanding is that it kills a significant optimization opportunity (that is currently taken advantage of by compilers).

	Daveed



More information about the ub mailing list