3 ms·
I don't understand why in Rust integers wrap around. It doesn't make sense and there are vulnerabilities caused by wrapping integers in C.
by codedokode 3y ago
I don't understand why in Rust integers wrap around. It doesn't make sense and there are vulnerabilities caused by wrapping integers in C.
- sdfghswe 3y agoWhat's the alternative? What would you expect happens?
- codedokode 3y agoPanic so that the invalid value doesn't get stored into the database or somewhere else. The developer then would notice the problem and fix it. Silently using invalid value is the worst choice.
- sdfghswe 3y agoPardon my ignorance, but what does "panic" mean, specifically?