unsigned use of Tcl_ObjPrintf() doesn't work as expected
Closed / Fixed0d78177f20f8d1ae835446853338714b256c06cdCreated 3 years agoUpdated 3 years ago
Descriptionwiki2024-02-01 21:09:57
Running
Tcl_ObjPrintf(interp, "%lu", 18446744073709551615UL)
on a 64-bit platform gives:
Unable to format "%lu" with supplied arguments: -1
The problem is in function AppendPrintfToObjVA()'s use of va_arg(): it generates a negative Tcl_WideInt in this case.
Referenced by2
b826c4d1e8Merge [f08e71ebd9742f29]: Fix [0d78177f20]: unsigned use of Tcl_ObjPrintf() doesn't work as expected. With testcases. check-in2024-08-25 08:33:537abae71820Fix [0d78177f20]: unsigned use of Tcl_ObjPrintf() doesn't work as expected. With testcases. check-in2024-02-01 21:44:49
jan.nijtmanswiki2024-02-01 22:14:17
Fixed in core-8-branch and trunk.
It appears that this bug was introduced with TIP #476: I tried it with 8.6 as well, and there it works as expected.
So, can be closed now.
Log in (anonymous is fine) to add a comment.