On May 7, 2007, at 17:25 , John M McIntosh wrote:
Ok, I was working with Craig a bit on this and I noticed for example.
usqInt endOfMemory;
sqInt fwdBlock2;
/* begin restoreHeadersAfterForwardBecome: */ fwdBlock2 = ((foo->endOfMemory + BaseHeaderSize) + 7) & (WordMask
- 7); flag("Dan"); fwdBlock2 += BytesPerWord * 4;
Really shouldn't one consider that if a unsigned value gets assigned to a signed integer one should really consider that a possible problem?
Needless to say I believe the code above won't work as intended.
Shooting from the hip and all, but I'd say thanks to two's complement this actually should work. Far from pretty or desirable, but it should generate the same code (unless the C compiler inserts specific checks which it should not and AFAIK it does not).
- Bert -