4 ms·
Integer overflow works as expected, like in C.
by amedvednikov 4y ago
Integer overflow works as expected, like in C.
- ben-schaaf 4y agoSigned integer overflow is undefined behavior in C. Is it also therefore undefined behavior in V?
- raphlinus 4y agoThank you for posting such a beautiful example of a false claim about your language. The front page of vlang.io has prominently featured under "Safety" the line "No undefined behavior". Saying that C-like undefined behavior[1] is "expected" directly contradicts that. I'll also point out that Nim, another language which compiles to C as a target, addresses this correctly. [1]: https://raphlinus.github.io/programming/rust/2018/08/17/undefined-behavior.html https://raphlinus.github.io/programming/rust/2018/08/17/unde...
- thedufer 4y agoYour website says on the homepage "No undefined behavior". Integer overflow in C is explicitly undefined behavior. What does the phrase "undefined behavior" mean to you? Because it's clearly something very different from what it means to the rest of the industry.
- Octoth0rpe 4y agoI think there's a communication issue on your end here. If someone raises an issue re: integer overflows, and you don't change the behavior, it's not 'fixed'. It may be 'addressed' or 'resolved' by responding with with something like "it's working as designed" or "if it's good enough for C, it's good enough for me!", but it's _not_ fixed. I don't think you should claim: > All of the issues there were fixed several days ago I really do like V FWIW.