Closed hernanponcedeleon closed 3 years ago
How are we supposed to interpret "implementation-defined behaviour"?
The programs in this repository are to be interpreted as GNU C, so where the standard mentions implementation-defined behavior we need to check what gcc defines.
Can this be closed or are there open questions?
Yes.
How are we supposed to interpret "implementation-defined behaviour"?
My understanding is that this is "danger zone" and we should avoid them if possible. However I found this benchmark by @Heizmann which exercise exactly this and it is marked as no-overflow, suggesting SVCOMP does not consider implementation-defined behaviour "dangerous" (or to be avoided as undefined behaviour).
To give some context, the
reducercommutativity/rangesum(X).c
benchmarks fit in this pattern.The initial version of the benchmarks defined
ret
(inrangesum
) as anint
. Later it was changed tolong long
due to a possible overflow (not shown here). I think the best for this kind of benchmarks would be to change the return value ofrangesum
and the value ofret
inmain
tolong long
.