[rust-dev] Integer overflow, round -2147483648

Daniel Micay danielmicay at gmail.com
Sun Jun 22 14:31:51 PDT 2014

On 22/06/14 05:09 PM, Rick Richardson wrote:
> Apologies if this has been suggested, but would it be possible to have a
> compiler switch that can add runtime checks and abort on
> overflow/underflow/carry for debugging purposes, but the default
> behavior is no check?  IMO this would be the best of both worlds,
> because I would assume that one would really only care about checked
> math during testing and dev.

You would need to build an entirely separate set of standard libraries
with checked overflow. Adding new dialects of the language via compiler
switches is never the right answer. It seems that every time an issue
like this comes up, people propose making a compiler switch as the option.

If we had compiler switches for abort vs. unwinding, no tracing gc
support vs. tracing gc support, no integer overflow checks vs. integer
overflow checks and more, we would have a truly ridiculous number of
language dialects. I think even 2 dialects is too much...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140622/038ad6ad/attachment.sig>

More information about the Rust-dev mailing list