On Jul 20 2010, Jeff Squyres wrote:
>> > Also, it seems like the 3rd parameter could be problematic if it ever
>> > goes larger than 2B -- it'll increment in the wrong direction, won't
>> > it?
>> Not on most systems.
> Ah -- I just checked -- the associativity of + and (cast) are equal, and
> are right to left. So it should be ok.
No, they aren't! That's unary plus. Cast binds more strongly. The reason
that it is OK is that uint32_t and int32_t are required to be twos'
> But still, for defensive
> programming purposes, I'd prefer this:
> } while
That parses differently, but is semantically equivalent with twos'
complement and quiet wrapping on overflow. I agree that it's a bit cleaner.