Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 59801c8edf946da3dd2c7bfe4cfb52468496c524
Ticket: 219223ffffffffffffffffffffffffffffffffff
64 bit format command behaves differently to the 32bit forma
User & Date: nobody on 2000-10-26 05:03:48
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 4087 Bug
    Version: 8.3b2
    SubmitDate: '2000-01-26'
    LastModified: '2000-04-09'
    Severity: SER
    Status: Assigned
    Submitter: techsupp
    ChangedBy: hobbs
    RelatedBugIDs: 653
    OS: Solaris
    OSVersion: Solaris 7 64 bit
    Machine: Ultra Enterprise 4500
    FixedDate: '2000-10-25'
    ClosedDate: '2000-10-25'
    
    
    Name: Matthew Finch
    
    ReproducibleScript:
    If I compile tcl8.3b2 in 64 bit mode on Solaris 7 using -xarch=v9 then
    perform the following I get....
    
    # ./tclsh
    % format %X 4294967290
    integer value too large to represent as non-long integer
    % 
    
    If I compile tcl8.3b2 in 32 bit mode on Solaris 7 then perform the
    following I get...
    
    # ./tclsh
    % format %X 4294967290
    FFFFFFFA
    % 
    
    The problem is relates to the casting in Tcl_GetIntFromObj()
    
        if (((long)((int)l)) == l) {
            *intPtr = (int)objPtr->internalRep.longValue;
            return TCL_OK;
        }
    
    The results should be the same.
    
    ObservedBehavior:
    If I compile tcl8.3b2 in 64 bit mode on Solaris 7 using -xarch=v9 then
    perform the following I get....
    
    # ./tclsh
    % format %X 4294967290
    integer value too large to represent as non-long integer
    %
    
    DesiredBehavior:
    I expect to see the same behaviour as when I compiled tclsh on Solaris 7 in 32 bit mode
    
    e.g
    # ./tclsh
    % format %X 4294967290
    FFFFFFFA
    %
    
    
    
    Actually, there is some level of correctness here.  The number
    the user is using is just -6 as far as Tcl is concerned on a
    32bit system.  When there are true longs, then Tcl handles the
    number properly in certain contexts.  However, format currently
    isn't one of them.  This should be revisited in 8.4 to look at
    expanding the use of Tcl_GetLongFromObj, which would solve the
    problem here.  We just need to make sure it won't confuse
    something else down the chain that will choke on the long value. 
    -- 04/09/2000 hobbs
    
  4. foundin changed to: "obsolete: 8.3b2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "81. Bundled Packages"
  10. title changed to:
    64 bit format command behaves differently to the 32bit forma
    
  11. type changed to: "Bug"