Skip to content
Tcl Source Code History Of Ticket 1154163
Login

History Of Ticket 1154163

Artifacts Associated With Ticket 1154163

  1. Ticket change [faddc77abb] (rid 91958) by matzek on 2005-03-01 11:48:17:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OS:
      % parray tcl_platform
      tcl_platform(byteOrder) = littleEndian
      tcl_platform(machine)   = alpha
      tcl_platform(os)        = OSF1
      tcl_platform(osVersion) = V5.1
      tcl_platform(platform)  = unix
      tcl_platform(user)      = makr
      tcl_platform(wordSize)  = 8
      
      [format] returns another format string instead of result:
      % format "%hx" 1
      lx
      % format "%hu" 1
      lu
      % format "%hd" 1
      ld
      % format "%hi" 1
      ld
      
      Expected same behavior as on Solaris 8 / 64 bit:
      OS:
      % parray tcl_platform
      tcl_platform(byteOrder) = bigEndian
      tcl_platform(machine)   = sun4u
      tcl_platform(os)        = SunOS
      tcl_platform(osVersion) = 5.8
      tcl_platform(platform)  = unix
      tcl_platform(user)      = makr
      tcl_platform(wordSize)  = 8
      
      % format "%hx" 1
      1
      % format "%hu" 1
      1
      % format "%hd" 1
      1
      % format "%hi" 1
      1
      
      I suspect the following code to be the trouble maker,
      although I do not have a clue what it wants to achive ...
      
      in tcl8.4.9/generic/tclCmdAH.c:
        2205  #if (LONG_MAX > INT_MAX)
        2206              /*
        2207               * Add the 'l' for long format type
      because we are on an
        2208               * LP64 archtecture and we are
      really going to pass a long
        2209               * argument to sprintf.
        2210               */
        2211              newPtr++;
        2212              *newPtr = 0;
        2213              newPtr[-1] = newPtr[-2];
        2214              newPtr[-2] = 'l';
        2215  #endif /* LONG_MAX > INT_MAX */
      
      kind regards
      -- Matthias Kraft
      
    4. foundin initialized to: "obsolete: 8.4.9"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "matzek"
    9. subsystem initialized to: "16. Commands A-H"
    10. title initialized to:
      [format] can not cope with 'h' length modifier on Tru64
      
    11. type initialized to: "Bug"
  2. Ticket change [618d8ee406] (rid 92260) by matzek on 2005-03-01 19:26:51:

    1. icomment:
      Logged In: YES 
      user_id=330806
      
      Well, I was right ...
      
      Inserting printf()s before and after that code shows:
      
      % format "%hx" 1
      >>> format: %hx
      >>> format: %hlx
      lx
      
      And removing the lines 2211 up to and including 2213 now
      returns the correct result:
      
      % format "%hx" 0x12480
      >>> format: %hx
      >>> format: %lx
      2480
      
      What's the drawback?
      
      kind regards
      -- Matthias Kraft
      
      
    2. login: "matzek"
    3. mimetype: "text/plain"
    4. username: "matzek"
  3. Ticket change [13d47a7842] (rid 124286) by matzek on 2005-03-03 23:27:10:

    1. icomment:
      Logged In: YES 
      user_id=330806
      
      Well, despite the fact Tcl can only be called in batch mode
      on AIX 5.1 / 64 bit - see bug: [ 1155891 ] TEBC segfaults
      (AIX 5.1 / 64 bit) - it also reveals format is also not
      working correctly here:
      
      /RDS/COMPSRV/prog/makr/tcl8.4.9/unix$ echo "puts [format
      \"%hx\" 0x12340]\n" > crashtest.tcl                        
                                                             
      /RDS/COMPSRV/prog/makr/tcl8.4.9/unix$
      /RDS/COMPSRV/prog/makr/tcl-8.4.9/bin/tclsh8.4 ./crashtest.tcl
      lx
      
      Raising priority, because this is a platform I will need 64
      bit support in the near future, while Tru64 is dying out...
      
      kind regards
      -- Matthias Kraft
      
      
    2. login: "matzek"
    3. mimetype: "text/plain"
    4. priority changed to: "7 High"
    5. title changed to:
      bug in 'h' length modifier of [format] on AIX 5/64 & Tru64
      
    6. username: "matzek"
  4. Ticket change [6af8cf5c9e] (rid 128238) by msofer on 2005-03-03 23:33:24:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      I'd keep this in the backburner until we sort out 1155891:
      that one looks like mem corruption. This bug may just be a
      symptom ...
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  5. Ticket change [371ab8afc4] (rid 107221) by dkf on 2005-03-08 04:30:29:

    1. priority changed to: "8"
  6. Ticket change [edf1613a2f] (rid 103997) by dkf on 2005-03-08 04:30:30:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Looks to me like we need to ensure that h is not mixed with
      l (or ll, but that's a 32-bit machine thing). Approximately,
      h=>16-bit, no-mod=>32-bit/machine-word, l=>64-bit, so mixing
      them doesn't make sense...
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  7. Ticket change [72374dc692] (rid 100820) by dkf on 2005-06-18 06:42:43:

    1. closedate changed to: "2005-06-17T23:42:43"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      I think I've fixed this now (8.4 branch and HEAD).
      Sorry for taking so long
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dkf"