Skip to content
Tcl Source Code View Ticket
Login

View Ticket

wrong return value from [binary scan] with 64-bit values

Closed / Out of Date765156ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2003-07-03 07:36:51
the system:
::tcl_platform(byteOrder) = littleEndian
::tcl_platform(machine)   = intel
::tcl_platform(os)        = Windows NT
::tcl_platform(osVersion) = 4.0
::tcl_platform(platform)  = windows
::tcl_platform(wordSize)  = 4

::tcl_patchLevel = 8.4.1



binary scan [binary format w [expr wide 
(0xA0A0A0A080000000)]] w value
1
(Desktop) 74 % format %lx [expr wide ($value)]
ffffffff80000000


correct example:
binary scan [binary format w [expr wide 
(0xA0A0A0A07FFFFFFF)]] w value
1
(Desktop) 70 % format %lx [expr wide ($value)]
a0a0a0a07fffffff



Description:
The binary scan command apparently interpretes the 
MSW of the 64-bit binary string as 0xFFFFFFFF if the 
LSW is greater than 0x80000000.
nobodyplain2003-07-03 15:34:28
Logged In: NO 

Clarified! Fixed with new tcl patchlevel 8.4.3
dkf Closed ticket [765156ffff]. [History diff]2003-07-03 16:18:30
Log in (anonymous is fine) to add a comment.