<i>StringObj.3 Tcl_ObjPrintf inaccuracies</i> status still Open with 4 other changes
by
.
D 2024-02-01T09:33:26.355
J icomment Here\sare\srelated\smessages\sfrom\sthe\score\slist\sfor\sdocumentation:\r\n\r\n--------\sWeitergeleitete\sNachricht\s--------\r\nBetreff:\s\t[TCLCORE]\sBackport\s%ll\sin\sTcl_ObjPrintf\r\nDatum:\s\tWed,\s31\sJan\s2024\s16:15:45\s+0100\r\nVon:\s\tEric\sBoudaillier\s<[email protected]>\r\nIn\sTcl\s8.6,\sthe\sdocumentation\ssays\sthat\sTcl_ObjPrintf()\sworks\slike\s[format].\r\nHowever\sthis\sis\snot\strue\sin\s8.6.13.\r\nA\sfix\shas\sbeen\sdone\shere:\shttps://core.tcl-lang.org/tcl/info/eac13870dca5d4e7\s<https://core.tcl-lang.org/tcl/info/eac13870dca5d4e7>\sfor\sTcl\s9.\r\nIs\sit\spossible\sto\sbackport\sthis\sfor\sthe\snext\s8.6.14?\r\n\r\nI'm\strying\sto\suse\sTcl_ObjPrintf("%lu")\sto\screate\sTcl_Obj\sfor\sunsigned\s64\sbits.\r\nOr\sis\sthere\sa\sbetter\sway\sto\sdo\sthis?\r\n\r\nWhat\sI\sam\sreally\slooking\sfor\sis\sin\sthis\scommit\shttps://core.tcl-lang.org/tcl/info/4c2ed52f8f2e2e50,\swhere\sa\ssingle\s"l"\smodifier\screates\sa\swideInt.\r\n\r\nOK,\sI\sshould\shave\slooked\sat\sexisting\stickets\sbefore\sthe\scode\s:-)\r\nThere\sis\salready\ssome\s(very\sold)\stickets\sabout\sthis:\r\n*\shttps://core.tcl-lang.org/tcl/tktview/2089279fffffffffffff\sthis\sone,\sstill\sopen,\salready\ssays\sthat\s[format]\suse\s64\sbits\sfor\s%l\smodifier,\s%lld\sfor\sBigNum.\r\n*\shttps://core.tcl-lang.org/tcl/tktview/2b6a4fa5ed30b44364b1\sthis\sone\sis\swhat\sI\sobserve,\ssaying\sit\sis\sfixed\sin\s8.7.\sSo\swhat\sabout\s8.6?\r\n*\shttps://core.tcl-lang.org/tcl/tktview/3fbaa4e23bfa711c4340\ssimilar\sto\sprevious\sone,\salso\sfor\s8.7\sonly.\r\n\r\nSince\swe'll\shave\sno\s8.7,\scould\sthat\sbe\sbackported\sin\s8.6?\r\n\r\nBut\sI'll\sprobably\screate\sa\snew\sticket,\sit\sseems\sthat\sthe\scode\sin\stip\sis\sstill\snot\saligned\swith\swhat\sdoes\s[format]:\r\n\r\n\t\tcase\s1:\r\n\t\t\s\s\s\sTcl_ListObjAppendElement(NULL,\slist,\sTcl_NewWideIntObj(\r\n\t\t\t\s\s\s\sva_arg(argList,\slong)));\r\n\t\t\s\s\s\sbreak;\r\n\t\tcase\s2:\r\n\t\t\s\s\s\sTcl_ListObjAppendElement(NULL,\slist,\sTcl_NewWideIntObj(\r\n\t\t\t\s\s\s\sva_arg(argList,\sTcl_WideInt)));\r\n\t\t\s\s\s\sbreak;\r\n\r\n--------\sWeitergeleitete\sNachricht\s--------\r\nDatum:\sWed,\s31\sJan\s2024\s17:34:43\s+0100\r\nVon:\sJan\sNijtmans\s<[email protected]>\r\n\r\nOp\swo\s31\sjan\s2024\som\s17:19\sschreef\sEric\sBoudaillier:\r\n>\sSince\swe'll\shave\sno\s8.7,\scould\sthat\sbe\sbackported\sin\s8.6?\r\n\r\nIt's\sa\slittle\sbit\stricky,\sbut\spossible.\sIf\swe\simplement\s"ll",\sit's\stempting\r\nto\suse\sTCL_LL_MODIFIER,\swhich\sresults\sin\s"I64"\son\sWin64.\sSo\swe\r\nshould\simplement\sthat\stoo.\sAnd\sbecause\s"format"\suses\sthe\ssame\r\nfunctionality\s....\r\n\r\nI\sthink\sthis\sshould\sdo\sit:\r\n\s\s\s\s\s<https://core.tcl-lang.org/tcl/info/c6795d89c8467204>\r\n\r\n--------\sWeitergeleitete\sNachricht\s--------\r\nDatum:\s\tWed,\s31\sJan\s2024\s18:01:26\s+0100\r\nVon:\s\tEric\sBoudaillier\s<[email protected]>\r\n\r\nI'm\snot\ssure...\r\nWhat\syou\swrote\sfor\scase\s2\s(%ll)\sis\swhat\sI'd\slike\sfor\scase\s1\s(%l),\sand\swhat\sdoes\s[format].\r\ncase\s2\sneeds\sto\spass\sa\sbignum\s(same\sas\scase\s3\sfor\s'L'\smodifier\s-\snot\sin\stip?\swhere\sdid\sI\ssee\sthat...).\r\nI32\sand\sI64\sare\snot\sspecified\sin\s8.6\sformat.n,\snot\sneeded\sin\smy\smind,\sI\sdon't\swant\sto\schange\sthe\sdoc,\sjust\sfix\sthe\scode.\r\nIt's\snot\sclear\snow\sif\sTcl_ObjPrintf()\sis\ssupposed\sto\sdo\swhat\sprint()\sdoes\sor\swhat\s[format]\sdoes,\sbut\sthe\sdoc\ssays\s[format].\r\nI\shave\sused\sit\sbecause\sprintf()\swas\sdifferent\sacross\swindows/linux/32/64\sbits.\r\n\r\n--------\sWeitergeleitete\sNachricht\s--------\r\nDatum:\sWed,\s31\sJan\s2024\s21:33:33\s+0100\r\nVon:\sJan\sNijtmans\s<[email protected]>\r\n\r\nOp\swo\s31\sjan\s2024\som\s18:01\sschreef\sEric\sBoudaillier:\r\n>\r\n>\sI'm\snot\ssure...\r\n>\sWhat\syou\swrote\sfor\scase\s2\s(%ll)\sis\swhat\sI'd\slike\sfor\scase\s1\s(%l),\sand\swhat\sdoes\s[format].\r\n\r\nI'm\ssure.\sTcl_WideInt\sstands\sfor\s"long"\son\s64-bit\splatforms,\s"long\r\nlong"\son\s32-bit\r\nplatforms\sand\s__int64\son\sWindows.\sSo,\sthe\sportable\sway\sto\sformat\r\na\sTcl_WideInt\sis\susing\sTCL_LL_MODIFIER,\swhich\sis\s"l"\son\smost\splatforms\r\n(like\syou),\s"ll"\son\s32-bit\splatforms\sand\s"I64"\son\sWindows.\sIf\swe\swant\sto\r\nsupport\sTcl_WideInt\sin\sa\sportable\sway,\swe\sneed\sto\simplement\sall\sof\sthem,\r\neven\sthough\s_you_\sprobably\sonly\sneed\s"l".\r\n\r\ncase\s1\sis\sfor\s"long"\s("l"),\scase\s2\sis\sfor\s"long\slong"\s("ll")\r\n\r\n--------\sWeitergeleitete\sNachricht\s--------\r\nDatum:\sWed,\s31\sJan\s2024\s20:39:47\s+0000\r\nVon:\sDonal\sFellows\s<[email protected]>\r\n\r\nJan\sNijtmans\s<[email protected]>\swrote:\r\n>\sI'm\ssure.\sTcl_WideInt\sstands\sfor\s"long"\son\s64-bit\splatforms,\s"long\slong"\son\s32-\r\n>\sbit\splatforms\sand\s__int64\son\sWindows.\sSo,\sthe\sportable\sway\sto\sformat\sa\r\n>\sTcl_WideInt\sis\susing\sTCL_LL_MODIFIER,\swhich\sis\s"l"\son\smost\splatforms\s(like\r\n>\syou),\s"ll"\son\s32-bit\splatforms\sand\s"I64"\son\sWindows.\sIf\swe\swant\sto\ssupport\r\n>\sTcl_WideInt\sin\sa\sportable\sway,\swe\sneed\sto\simplement\sall\sof\sthem,\seven\sthough\r\n>\s_you_\sprobably\sonly\sneed\s"l".\r\n\r\nIt's\sa\sshame\sthat\sit's\scurrently\sthe\sthing\sthat's\smaking\sTcl\sbuilds\snoisy,\swith\smessages\slike\sthis\scoming\sup\srather\soften:\r\n\r\n.../tcl/generic/tclHash.c:636:21:\swarning:\sformat\s'%u'\sexpects\sargument\sof\stype\r\nunsigned\sint',\sbut\sargument\s5\shas\stype\s'size_t'\s{aka\s'long\slong\sunsigned\sint'}\s[-Wformat=]\r\n\s\s636\s|\s\s\s\s\ssnprintf(p,\s60,\s"number\sof\sbuckets\swith\s%d\sor\smore\sentries:\s%"\sTCL_Z_MODIFIER\s"u\\n",\r\n\s\s\s\s\s\s|\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\s\s637\s|\s\s\s\s\s\s\s\s\s\s\s\s\sNUM_COUNTERS,\soverflow);\r\n\s\s\s\s\s\s|\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s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"\sTCL_Z_MODIFIER\s"llu\r\n\r\nI'm\snot\spicking\son\sthat\sspecific\ssite\sat\sall;\sit's\sjust\sthe\sfirst\sone\sI\sfound\sin\smy\slocal\sbuild\slogs.\r\n\r\n--------\sWeitergeleitete\sNachricht\s--------\r\nDatum:\s\tThu,\s1\sFeb\s2024\s05:55:22\s+0100\r\nVon:\s\tEric\sBoudaillier\s<[email protected]>\r\n\r\nOK,\slet's\sseparate\sthe\sproblems.\r\nI\ssolved\smy\sunsigned\s64\sbits\sgeneration\sby\susing\sTcl_Format("%lu"),\swhich\sworks\sas\sexpected:\s%l\sfor\swide\sints,\sfor\s32\sbits\s/\s64\sbits\sbuilds.\r\n\r\nI\swrongly\sused\sTcl_ObjPrintf(),\sbecause\sthere\sis\sa\sdiscrepancy\son\show\sit\smanages\s%l\s/\s%ll,\seven\sin\sTcl\s9.0b1\s(windows\s32\sbits\sbuilds):\sTcl_ObjPrintf("%lu")\struncates\sto\s32\sbits,\sTcl_Format("%lu").always\sformats\s64\sbits.\r\nThe\sdiscrepancy\sbetween\sTcl_ObjPrintf()\sand\sTcl_Format()\sshould\sbe\snoted\sin\sthe\sdoc,\sand\s%l\s/\s%ll\sspecified.\r\nEven\sthe\simplementation\sis\smisleading,\sboth\sare\susing\sTcl_AppendFormatToObj().
J login oehhar
J mimetype text/plain
J username oehhar
K 2089279fffffffffffffffffffffffffffffffff
U oehhar
Z 43f84339a87f52de183b7c562c9bbcd1