Artifacts Associated With Ticket 0842331eba
Ticket change [fb4399791c] (rid 199138) by anonymous on 2022-03-14 07:49:32:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
I'm seeing a platform dependency in the Tcl "scan" command when it comes to conversion of oversized positive decimal numbers. According to the docs, "scan ... %d" is supposed to return the greatest integer value that makes sense - according to the given size modifiers. Without any size modifier (just %d) I'd expect to get a large positive number. But instead, I get this on a LP64 machine (x64 GNU/Linux): % info patchlevel 8.6.4 % set tcl_platform(wordSize) 8 % scan 11111111111111111111 %d -7335632962598440505 ...whereas on a ILP32 machine (x86 GNU/Linux) I get this: % info patchlevel 8.6.4 % set tcl_platform(wordSize) 4 % scan 11111111111111111111 %d 2147483647 I've found old bug #1011860 [https://core.tcl-lang.org/tcl/tktview/1011860fffffffffffff], which seems to be related to this. What's going on here?
- foundin initialized to: "8.6.4"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- private_contact initialized to: "7059cfaad662ca85cba09bbf879f8783c497066b"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "23. [scan]"
- title initialized to: "[scan _ %d] 64-bit issue"
- type initialized to: "Bug"
Ticket change [bb3128532a] (rid 199965) by chrstphrchvz on 2022-04-07 17:53:52:
- icomment:
<blockquote>Without any size modifier (just <tt>%d</tt>) I'd expect to get a large positive number.</blockquote> The [https://www.tcl.tk/man/tcl8.6/TclCmd/scan.html#M7|documented behavior] of not specifying a size modifier is the same as using the <tt>h</tt> size modifier, which restricts the range to that of <tt>expr int(…)</tt> which is determined by <tt>$tcl_platform(wordSize)</tt>. The scan range is unlimited only when the <tt>ll</tt> size modifier is used.
- login: "chrstphrchvz"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [78652b1f6b] (rid 199968) by oehhar on 2022-04-07 19:27:20:
- icomment:
Christopher, I enjoy to clicking "approve" for every valuable ticket you provide, it is a honor to do this small service ;-). But maybe, someone gives your user name "chrstphrchvz" at least comment rights, so the moderator approval is not necessary any more... Maybe, this might be ok for you ? Take care, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [b8c65d2946] (rid 199969) by fvogel on 2022-04-07 22:00:46:
- icomment: "@oehhar: done."
- login: "fvogel"
- mimetype: "text/plain"
Ticket change [4a3c033c5f] (rid 219209) by chrstphrchvz on 2023-10-09 20:30:42:
- closedate changed to: "2460227.35466329"
- closer changed to: "chrstphrchvz"
- login: "chrstphrchvz"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Invalid"
- status changed to: "Closed"