Skip to content
Tcl Source Code View Ticket
Login

View Ticket

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
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.