Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f6e03252d6e52c69f6ded99c21bf52a3ccd1e058
Ticket: 219223ffffffffffffffffffffffffffffffffff
64 bit format command behaves differently to the 32bit forma
User & Date: kennykb on 2002-02-19 06:04:55
Changes

  1. icomment:
    Logged In: YES 
    user_id=99768
    
    dgp says that sizeof(int) == 4, while 
                  sizeof(long) == sizeof(void*) == 8.
    
    UINT_MAX is 0xffffffff.
    
    The problem is that 0xfffffffa < UINT_MAX.  The test at line 2108
    of tclCmdAH.c reads:
    
    if ((unsigned long) intValue > UINT_MAX)
    
    This test detects that 0xfffffffa can be formatted with %d
    instead of %ld.  It cannot.
    
    In any case, the code at line 2211:
    
    sprintf(dst, newFormat, intValue);
    
    is surely not correct.  The case that we're testing here gets there
    with "%d" in newFormat, but "intValue" is a long: that surely cannot
    be expected to work!
    
    
  2. login: "kennykb"
  3. mimetype: "text/plain"
  4. username: "kennykb"