Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: faddc77abb2d1cbbd616434fc48c8a3db53ee83f
Ticket: 1154163fffffffffffffffffffffffffffffffff
bug in 'h' length modifier of [format] on AIX 5/64 & Tru64
User & Date: matzek on 2005-03-01 11:48:17
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed 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 changed to: "obsolete: 8.4.9"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "matzek"
  9. subsystem changed to: "16. Commands A-H"
  10. title changed to:
    [format] can not cope with 'h' length modifier on Tru64
    
  11. type changed to: "Bug"