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

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 21 00:10:55 PST 2014


Walter Bright:

> All you're doing is trading 0 crossing for 0x7FFFFFFF crossing 
> issues, and pretending the problems have gone away.

I'm not pretending anything. I am asking in practical programming 
what of the two solutions leads to leas problems/bugs. So far 
I've seen the unsigned solution and I've seen it's highly 
bug-prone.


> BTW, granted the 0x7FFFFFFF problems exhibit the bugs less 
> often, but paradoxically this can make the bug worse, because 
> then it only gets found much, much later in supposedly tested & 
> robust code.

Is this true? Do you have some examples of buggy code?

Bye,
bearophile


More information about the Digitalmars-d mailing list