gdesroches wrote:Unless I'm missing something, those last two problems mentioned in the video don't seem like problems at all (besides the code being messy). Since integers and longs remain 32-bit, there should be no problem comparing one to 0xFFFFFFFF or masking 0x80000000. There would be a problem when doing this with pointers, but who in there right mind would mask or hardcode a pointer like that?Let me know if I missed the point.
What I really want to know is where to find out about these semantics, as it would be very handy.I.E.int x = -30;unsigned int y = 20;(x + y) gives an unsigned int???
Buzza wrote:What I really want to know is where to find out about these semantics, as it would be very handy.
What I really want to know is where to find out about these semantics, as it would be very handy.
In Section 4.10, advice item [18] is:"Avoid unsigned arithmetic":)