> Ada's approach to integer overflows is substantially similar to AIR
Isn't Ada's response to overflow implementation-defined?

Sort of.

First, the standard seems to require a Constraint_Error when signed integer overflow happens. For example, on page 47 of the ADA 2012 standard:

"For a signed integer type, the exception Constraint_Error is raised by the execution of an operation that cannot deliver the correct result because it is outside the base range of the type."

  http://www.ada-auth.org/standards/12rm/RM-Final.pdf

On the other hand, other parts of the standard provide significant wiggle room, giving a design that I believe is more or less equivalent to AIR. The discussion here is the best that I know of:

  http://gcc.gnu.org/ml/gcc/2009-07/msg00486.html

I believe that Ada's design point is a solid one.

John Regehr
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to