News for hackers. Stuff that matters.
Re:Almost Always Unsigned by kazinator on Sunday January 02, 2022 @11:26AM (#29770060)
Conversion from signed to unsigned is implicit and silent. The expression being converted to your "can never be negative" type isn't nonnegative!!! Its value drastically changes; e.g. -3 becomes a huge number.
Re:Almost Always Unsigned by snovv_crash on Sunday January 02, 2022 @04:38PM (#29774212)
Not if you pass -Wconversion to GCC