Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2024-09-07
08:33 • New ticket [5f9a1cb24e] Is [4b12cc] (Allow format/scan %llu for positive numbers... artifact: 6d89a75259 user: chw
2024-05-02
12:46
Minimum backport [4b12ccb336] to Tcl 8.6. If we do %lld/%llu we should do the %I32/%I64 (microsoft-)... check-in: 96aa2c6b01 user: jan.nijtmans tags: rfe-4b12ccb336
12:07 • Ticket [4b12ccb336] format/scan %llu doesn't work status still Closed wi... artifact: 5259be46ea user: oehhar
09:53 • New ticket [cab08bbf04] Documentation of scan/format %llu incomplete. artifact: 8bbdfa875e user: oehhar
09:28 • Ticket [4b12ccb336] format/scan %llu doesn't work status still Closed wi... artifact: cb1ee6b4d6 user: oehhar
2021-01-22
15:53 • Closed ticket [4b12ccb336]. artifact: e949a70b86 user: jan.nijtmans
2017-04-12
13:52 • Open ticket [4b12ccb336]. artifact: 0f72f6ace8 user: jan.nijtmans
2017-04-05
09:38 • Closed ticket [4b12ccb336]. artifact: 54d765e83c user: jan.nijtmans
09:09
Fix [4b12ccb3363e81b132e8dbe12aeec596102be1a8|4b12ccb336]: format/scan %llu doesn't work. Also added... check-in: be99031456 user: jan.nijtmans tags: trunk
08:41
Fix [4b12ccb3363e81b132e8dbe12aeec596102be1a8|4b12ccb336]: format/scan %llu doesn't work. Also added... check-in: 80252e0aed user: jan.nijtmans tags: core-8-6-branch
08:14 • New ticket [4b12ccb336] format/scan %llu doesn't work. artifact: 1a617148c9 user: jan.nijtmans

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.