4 ms·
Using unsigned does not generally fix overflow flaws. It just moves the threshold.
by jeffbee 7y ago
Using unsigned does not generally fix overflow flaws. It just moves the threshold.
- yalogin 7y agoSure. I was not suggesting it that it will eliminate overflows but would eliminate one source of them. Also mostly because there are probably few use cases that warrant signed values.
- saagarjha 7y agoUsing unsigned numbers doesn't really fix anything here, because the Linux kernel defines overflow of signed numbers. In both cases, you have generally surprising behavior when the number gets large enough: changing the type doesn't help; it just hides the issue in one of the cases.