Skip to content
Tcl Source Code Artifact [7cea7f851d]
Login

Artifact [7cea7f851d]

Artifact 7cea7f851d8aa5b906de6adc868a3f98c3374677:

Ticket change [7cea7f851d] - Ticket [2848176fffffffff|2848176fff] <i>Invalid results from &quot;expr&quot;, v8.4.*, v8.5.*, v8.6.*</i> status still Open with 4 other changes by dgp on 2009-09-02 00:14:23.
D 2009-09-02T00:14:23
J icomment \nThis\sis\snot\sa\sbug.\s\sIt\sis\san\sintentional\sfeature\schange.\n\nStarting\swith\srelease\sTcl\s8.4.0\sin\s2002\s(!)\sthe\snumeric\nliteral\svalue\s"0x80000000"\sis\staken\sas\sthe\snumber\s2147483648\s.\nThis\sis\san\sincompatible\schange\sfrom\sTcl\s8.3\sand\searlier\nwhere\sthe\sinterpretation\swas\splatform\sdependent.\s\sOn\s32-bit\nsystems\sit\swas\sthe\snumber\s-2147483648\sand\son\s64-bit\nsystems\sit\swas\sthe\snumber\s2147483648.\s\sIt\swas\sTIP\s72\nthat\sstarted\sthis\schange,\sand\ssince\sthen\sTIP\s237\sextended\nthe\schange\sso\sthat\sinteger\sliterals\sare\sinterpreted\swithin\na\ssystem\sof\sunlimited\srange\sand\sno\soverflows\sat\sall.\nIf\syou\swant\sa\snegative\snumber\sin\shex\snotation,\syou\smust\nlead\swith\sthe\sminus\ssign.\n\nAlso,\sdo\snot\sover\slook\sthe\s"l"\sand\s"ll"\smodifers\sin\syour\n[format]\sspec's:\n\n%\sformat\s%#x\s[expr\s~0x80000000]\n0x7fffffff\n%\sformat\s%#lx\s[expr\s~0x80000000]\n0xffffffff7fffffff\n%\sformat\s%#llx\s[expr\s~0x80000000]\n-0x80000001\n\n\nSounds\slike\sthe\scrc*.tcl\sfiles\syou\shave\sare\sbuggy.\s\sEven\nwhen\sthey\smight\shave\sbeen\sused\swith\sTcl\s8.3,\sthey\swere\nstill\sbuggy,\ssince\sthey\sdid\snot\swork\son\s64-bit\ssystems.\s\sCheck\nthat\syou\sare\sstill\susing\ssome\sthat\sare\sout\sof\sdate.\s\sIf\snot,\nreport\sthe\sbugs\sto\sthe\smaintainer(s)\sof\sthe\spackage(s).\n\nThe\spossibly\slegitimate\sgripe\sagainst\sTcl\sis\sthat\nTcl\sdoes\snot\sprovide\sany\sgood\stools\sin\sthe\sbuilt-in\ncommand\sset\sto\seasily,\sefficiently,\sand\swith\scomplete\ncross-platform\sagreement\soperate\son\sdata\sknown\nto\sbe\s"32-bit\sintegers"\s\sor\s"64-bit\sintegers".\s\sTcl\sleaves\ntoo\smany\sof\sthe\sdefinitional\sdetails\sto\sthe\sunderlying\nC\simplementation.\s\sTcl\sscripts\sthat\sreally\swant\sto\soperate\non\s32-bit\sbuffers\sfind\sthat\sthey\sare\sforced\sto\sto\sa\slot\sof\nmasking\sagainst\s0xFFFFFFFF\sto\sget\sthe\sjob\sdone\sright.\nWhether\sthe\sright\sanswer\sto\sthis\sproblem\sis\smore\s\noperators\sand\soptions\sin\sTcl's\sbuilt-ins\sor\sa\sgood\nextension\sor\stwo,\sis\sa\smatter\sfor\ssomeone\smotivated\nto\spursue.\n
J login dgp
J mimetype text/plain
J username dgp
K 2848176fffffffffffffffffffffffffffffffff
U dgp
Z 78bd2665cbd4db92f9f8997616e2e3ef