Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fb4399791c8a89e120e0fdd88731d215f577bc45e223c713d7d5e78a6fa85d4c
Ticket: 0842331eba4e78318b795abcfddf84ad878311f1
[scan _ %d] 64-bit issue
User & Date: anonymous on 2022-03-14 07:49:32
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed 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?
    
  5. foundin changed to: "8.6.4"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "7059cfaad662ca85cba09bbf879f8783c497066b"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "23. [scan]"
  15. title changed to: "[scan _ %d] 64-bit issue"
  16. type changed to: "Bug"