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.
[ Parent
| on HN ]
Re:Almost Always Unsigned
by snovv_crash on Sunday January 02, 2022 @04:38PM
(#29774212)
Not if you pass -Wconversion to GCC