Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b8e5e816562a6e982a00a07fa30d535fe9a5c509
Ticket: 224600ffffffffffffffffffffffffffffffffff
Regression in 'scan' of large octal/hex integers
User & Date: kennykb on 2000-12-05 19:57:28
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    David Hawkins observes in
    <URL:http://x72.deja.com/viewthread.xp?AN=700160928>
    that the 'scan' comand in Tcl 8.3 has a regression from 8.0 in the handling of
    octal and hex representations of negative numbers.  For example:
    
    8.0 -- 'scan' could recover the result of 'format' applied to a negative number.
    % info tclversion
    8.0
    % info patchlevel
    8.0.5
    % set test1 [format {%o %x} -1 -1]
    37777777777 ffffffff
    % scan $test1 {%o %x} a b
    2
    % list $a $b
    -1 -1
    
    8.3 -- 'scan' no longer recovers the number.
    % info tclversion
    8.3
    % info patchlevel
    8.3.2
    % set test1 [format {%o %x} -1 -1]
    37777777777 ffffffff
    % scan $test1 {%o %x} a b
    2
    % list $a $b
    2147483647 2147483647
    
    There appears no longer to be any way to use the 'scan' command to
    recover the original number that was passed to 'format'.
    
    The fix is simple -- use strtoul instead of strtol to parse %o and %x
    formats.
    
    Patch with test cases will be submitted shortly.
    
  4. foundin changed to: "obsolete: 8.4a2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "kennykb"
  9. subsystem changed to: "81. Bundled Packages"
  10. title changed to: "Regression in 'scan' of large octal/hex integers"
  11. type changed to: "Bug"