News for hackers. Stuff that matters.
Re:Pitfalls in C and C++: Unsigned Types (2011) by duaneb on Wednesday September 25, 2013 @03:17PM (#6446673)
This is ok in general, but IMHO silently failing code (like a break condition that never happens because of overflow) is far worse than getting your arithmetic right. Getting it wrong implies a clear bug, whereas a seemingly bugless loop might be harder to identify as the source of the error.
Re:Pitfalls in C and C++: Unsigned Types (2011) by dllthomas on Wednesday September 25, 2013 @03:40PM (#6446817)
I think you either misread me, or I'm misreading you. I'm advocating the method that fails immediately (unsigned, so an underflow hits unmapped memory immediately and segfaults).