News for hackers. Stuff that matters.
Re:The Little C Function From Hell by duaneb on Wednesday June 20, 2012 @03:14AM (#4135949)
Actually, a colleague recently convinced me to start using signed ints for, e.g., for loops instead of unsigned ints. His reasoning was that if you're overflowing with signed integers, you'll probably overflow with unsigned integers too (we work with very large numbers), but it's easier to notice if you have a negative number rather than silently wrapping around to a still-valid value.
Re:The Little C Function From Hell by cperciva on Wednesday June 20, 2012 @04:13AM (#4136049)
99% of the time, you should not be using any sort of int for a loop variable. Loop variables are almost always array indexes, and array indexes should be size_t.