Portability bug in integral conversion

bearophile bearophileHUGS at lycos.com
Mon Jan 17 04:12:05 PST 2011


Walter:

> Look at the asm dump of a function. It's full of add's - not only ADD
> instructions, but addressing mode multiplies and add's. Subtraction is often
> expressed in terms of addition, relying on twos-complement wraparound.

This answer is a bit relevant only if the programmer is using inline asm, while the discussion was about unsigned differences in D code, that are uncommon in my D code. Sometimes I even assign lengths to signed-word variables, to avoid some signed/unsigned comparison bugs.

Bye,
bearophile


More information about the Digitalmars-d mailing list