Skip to content
Tcl Source Code View Ticket
Login

View Ticket

format/scan %llu doesn't work

Closed / Fixed4b12ccb3363e81b132e8dbe12aeec596102be1a8Created 10 years agoUpdated 3 years ago
Descriptionwiki2017-04-05 08:14:11
Example:
$ tclsh8.6
% scan 57 %llu a
unsigned bignum scans are invalid
% format %llu 57
unsigned bignum format is invalid

In ticket [1527169] I found the following explanation: "... and provided %llx, %llo, %llu and %lld format groups that work the same on all platforms."

Yes, %llu is provided on all platforms the same, but it always gives this error-message even though the provided number is positive. There is no reason why this would give an error, this error is not documented anywhere, neither are there any test-cases.

Suggestion (for 8.6 and up): Only when the formatted/scanned number is negative give this (same) error (for compatibility), for positive numbers let it behave the same as %lld. For negative numbers, another behavior could be implemented, but that's food for another TIP.

Referenced by3
jan.nijtmansplain2017-04-05 09:38:49
fix committed to core-8-6-branch and trunk
jan.nijtmansplain2017-04-12 13:52:46
Hmmm. Since TIP 237 explicitly mentions that "llu" is invalid, a TIP will be needed to correct this. Therefore changing this to an RFE. No problem, just more work ....
jan.nijtmanswiki2021-01-22 15:53:26

Fixed as part of the TIP #514 implementation. Already available in Tcl 8.7 alpha.

oehharwiki2024-05-02 09:28:55

I would favor to backport this to Tk 8.6. IMHO, it is just annoying...

Thanks, Harald

oehharwiki2024-05-02 12:07:03

The behaviour is documented with [cab08bbf04] also for the format case.

Log in (anonymous is fine) to add a comment.