|
2001-04-05
| ||
| 08:12 | • Ticket [224600ffff] Regression in 'scan' of large octal/hex integers... artifact: 77a4fb1cf9 user: dgp | |
|
2000-12-10
| ||
| 09:59 | • Closed ticket [224600ffff]. artifact: e11e23bd00 user: hobbs | |
|
2000-12-06
| ||
| 03:01 | • Ticket [224600ffff]: 4 changes artifact: dab519b7ac user: kennykb | |
|
2000-12-05
| ||
| 19:57 | • New ticket [224600ffff]. artifact: b8e5e81656 user: kennykb | |
Regression in 'scan' of large octal/hex integers
Closed / Fixed224600ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-12-05 19:57:28
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.
kennykbplain2000-12-06 03:01:28
Patch is at https://sourceforge.net/patch/?func=detailpatch&patch_id=102663&group_id=10894
hobbsplain2000-12-10 09:59:14
Fixed with patch http://sourceforge.net/patch/?func=detailpatch&patch_id=102663&group_id=10894
dgp Ticket [224600ffff]: 3 changes
[History diff]2001-04-05 08:12:17
Log in (anonymous is fine) to add a comment.