Closed tueda closed 6 years ago
You can see the 40 errors in https://travis-ci.org/tueda/form/jobs/282633736 (found by searching for "runtime error"). A patch to fix (at least them) is https://github.com/tueda/form/commit/8a643ef468ec0b2f4e6890a1cb22d4bdcd4e9eae. I hope I didn't make any bugs or unreasonable overhead (with compiler optimization), but maybe it would be better for someone to review it.
The list of the 40 errors (line numbers are for the source before the patch):
argument.c:311:15: runtime error: left shift of negative value -1
argument.c:518:15: runtime error: left shift of negative value -1
compiler.c:1246:38: runtime error: signed integer overflow: 2147483600 + 48 cannot be represented in type 'int [27]'
compiler.c:1402:25: runtime error: negation of -2147483648 cannot be represented in type 'int [27]'; cast to an unsigned type to negate this value to itself
normal.c:1968:13: runtime error: left shift of negative value -1
normal.c:2585:13: runtime error: left shift of negative value -1
normal.c:2585:13: runtime error: left shift of negative value -4
normal.c:2691:15: runtime error: left shift of negative value -1
normal.c:767:14: runtime error: left shift of negative value -1
pre.c:4956:5: runtime error: signed integer overflow: 1701411834604692317 * 10 cannot be represented in type 'long int'
pre.c:4956:5: runtime error: signed integer overflow: 9223372036854775800 + 56 cannot be represented in type 'long int'
pre.c:5063:13: runtime error: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long int'
proces.c:2583:8: runtime error: left shift of negative value -1
proces.c:2583:8: runtime error: left shift of negative value -2
proces.c:2583:8: runtime error: left shift of negative value -3
proces.c:2807:5: runtime error: left shift of negative value -1
proces.c:4900:11: runtime error: left shift of negative value -1
proces.c:5409:9: runtime error: left shift of negative value -1
ratio.c:1080:13: runtime error: left shift of negative value -3
ratio.c:1333:12: runtime error: left shift of negative value -1
ratio.c:2916:14: runtime error: left shift of negative value -5
ratio.c:3515:15: runtime error: left shift of negative value -1
sort.c:1971:9: runtime error: left shift of negative value -1
sort.c:1971:9: runtime error: left shift of negative value -2
sort.c:1971:9: runtime error: left shift of negative value -5
token.c:1051:48: runtime error: signed integer overflow: 9223372036854775800 + 8 cannot be represented in type 'long int'
token.c:1051:51: runtime error: signed integer overflow: 100 * 1000000000000000000 cannot be represented in type 'long int'
token.c:1051:51: runtime error: signed integer overflow: 100 * 184467440737095516 cannot be represented in type 'long int'
token.c:992:49: runtime error: signed integer overflow: 9223372036854775800 + 8 cannot be represented in type 'long int'
token.c:992:52: runtime error: signed integer overflow: 100 * 184467440737095516 cannot be represented in type 'long int'
token.c:992:52: runtime error: signed integer overflow: 100 * 2000000000000000000 cannot be represented in type 'long int'
tools.c:2948:5: runtime error: signed integer overflow: 4294967296 * 4294967296 cannot be represented in type 'long int'
TFORM sometimes give an extra error:
reken.c:3785:5: runtime error: signed integer overflow: -3024007687874539721 - 6841854541025503534 cannot be represented in type 'long int'
Currently, enabling UndefinedBehaviorSanitizer (
-fsanitize=undefined
) gives 40 failures for the test suite.