Signed integer overflow undefined behavior or not?

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 12 22:00:14 PST 2015


On 11/12/2015 4:43 PM, Ali Çehreli wrote:
> So the question is, do we support twos complement only, hence signed overflow is
> defined as wrap,

Yes. I see no reason to support 1's complement.

It's worth checking how LDC and GDC deal with this deep in their optimizer - is 
it considering it undefined behavior?



More information about the Digitalmars-d mailing list