Development Log

  • GNAT Pro
    Apr 11th, 2008

    Avoid intermediate overflow for type conversion
    For an expression such as Integer (A + B), where A and B are Short_Integer and the result of the addition exceeds Short_Integer, it is allowed to get a constraint_error even though the result would fit in type Integer. This seems undesirable in this case, and the RM specifically allows for the possibility of not raising the exception if the right result is given. The compiler now takes advantage of this and does not raise CE in this case.