'int' is enough for 'length' to migrate code from x86 to x64

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 25 04:10:01 PST 2014


Don:

> Aargh! You're right. That's new, and dreadful. It didn't used 
> to be.
> The offending commit is
>
> alexrp              2012-05-15 15:37:24
>
> which only provides an unsigned example.
>
> Why are defining behaviour that is always a bug? Java makes it 
> defined, but it has to because it doesn't have unsigned types.
> I think the intention probably was to improve on the C 
> situation, where there is undefined behaviour that really 
> should be defined.
>
> But do we really want to preclude ever having overflow checking 
> for integers?

+1

Bye,
bearophile


More information about the Digitalmars-d mailing list