.
D 2022-02-16T00:15:17.973
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment UBSan\s(<tt>-fsanitize=signed-integer-overflow</tt>)\serrors\sfor\s32-bit\s<tt>long</tt>\sand\s64-bit\s<tt>long\slong</tt>:\r\n\r\n<blockquote><pre>\r\n%\sset\sa\s-0x8000000000000001;\sincr\sa\s1\r\n<span\sstyle="font-weight:bold">tcl/generic/tclObj.c:3576:6:<span\sstyle="color:red">\sruntime\serror:\s</span>negation\sof\s-9223372036854775808\scannot\sbe\srepresented\sin\stype\s'long\slong\sint';\scast\sto\san\sunsigned\stype\sto\snegate\sthis\svalue\sto\sitself</span>\r\n-9223372036854775808\r\n%\sset\sb\s-0x8000000000000001;\sincr\sb\s0x7fffffff80000001\r\n<span\sstyle="font-weight:bold">tcl/generic/tclObj.c:3550:6:<span\sstyle="color:red">\sruntime\serror:\s</span>negation\sof\s-2147483648\scannot\sbe\srepresented\sin\stype\s'long\sint';\scast\sto\san\sunsigned\stype\sto\snegate\sthis\svalue\sto\sitself</span>\r\n-2147483648\r\n</pre></blockquote>\r\n\r\nAs\swith\s[89de498973],\sthis\scan\sbe\savoided\sby\snegating\sbefore\scasting,\sand\sby\ssubtracting\sfrom\s0\s(binary\sminus)\sto\savoid\scompiler\swarnings\sfor\sunary\sminus\swith\sunsigned\soperand\s(e.g.\s[https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4146|MSVC\s<tt>/W2</tt>\swarning\sC4146]).\sSee\sattached\spatch.
J foundin core-8-6-branch
J is_private 0
J login chrstphrchvz
J priority 5\sMedium
J resolution None
J severity Minor
J status Open
J submitter chrstphrchvz
J subsystem 48.\sNumber\sHandling
J title signed\sinteger\soverflow\sin\sTcl_SetBignumObj()
J type Patch
K 1c60dca3412236a4992ff57dae575a7df91b65f0
U chrstphrchvz
Z 66dcc0a239c854a6dc119400e39f1fa0