Tcl Source Code

View Ticket
Login
Ticket UUID: 690774
Title: [binary scan] fails with certain 64-bit ints
Type: Bug Created on: 2003-02-21 17:26:41
Submitter: kennykb Assigned to: dkf
Subsystem: 12. ByteArray Object Severity:
Priority: 5 Medium Last modified: 2003-02-22 05:03:07
Status: Closed Closed by: dkf
Resolution: Fixed Closed on: 2003-02-21 22:03:07
Version: obsolete: 8.4.1
Description:
If a 'w' format group on [binary scan] gets a 64-bit integer with the 2**31 bit set, it returns incorrect 
results.

% binary scan [binary format w [expr { wide(3) << 31 }]] w x
1
% set x
-2147483648

% parray tcl_platform
tcl_platform(byteOrder) = littleEndian
tcl_platform(machine)   = intel
tcl_platform(os)        = Windows NT
tcl_platform(osVersion) = 5.0
tcl_platform(platform)  = windows
tcl_platform(user)      = kennykb
tcl_platform(wordSize)  = 4
% set tcl_patchLevel
8.4.1
User Comments:
dkf added on 2003-02-22 05:03:07:
Logged In: YES 
user_id=79902

What was I thinking of when I wrote that code? :^(