by wCxV8HzziQBb · 6mo ago · 0 comments
$ clang parseint.c -fsanitize=undefined -O0 -g -o parseint
$ ./parseint -9223372036854775808
parseint.c:38:23: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long'; cast to an unsigned type to negate this value to itself
result: -9223372036854775808
edit: this is just to show that getting undefined behavior right is hard!No comments yet.