Skip to content

Conversion long -> int violates no-overflow

Created by: tautschnig

The rules for "G ! overflow" state: "It can never happen that the resulting type of an operation is a signed integer type but the resulting value is not in the range of values that are representable by that type."

As INT_MAX+1 (2147483648L) is not in the range of values of int (for any architecture where sizeof(int)<=4), the property no-overflow is false.

Note that the C standard, as explained in the benchmark, marks this as implementation-defined behaviour, not as undefined behaviour.

Merge request reports