Closed
Description
CBMC provides "verification failed" for the following C program extracted from sv-benchmarks/c/signedintegeroverflow-regression/ConversionToSignedInt_true-no-overflow.c.i.
$cbmc ConversionToSignedInt_true-no-overflow.c --signed-overflow-check
#include <stdio.h>
int main() {
// The literal of type long on the right-hand side is exactly INT_MAX+1 and will
// be converted to int.
// Paragraph 6.3.1.3.3 of C11 says that if "[..] the new type is signed and the
// value cannot be represented in it; either the result is implementation-defined
// or an implementation-defined signal is raised."
int x = 2147483648L;
printf("%d\n", x);
return 0;
}
** Results:
[main.overflow.1] arithmetic overflow on signed type conversion in (signed int)2147483648l: FAILURE
** 1 of 1 failed (1 iteration)
VERIFICATION FAILED
Metadata
Metadata
Assignees
Labels
No labels