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
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- 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. - foundin changed to: "obsolete: 8.4a2"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "kennykb"
- subsystem changed to: "81. Bundled Packages"
- title changed to: "Regression in 'scan' of large octal/hex integers"
- type changed to: "Bug"