Tcl Source Code

View Ticket
Login
Ticket UUID: 1117017
Title: Manpage inconsistent for binary scan
Type: Bug Created on: 2005-02-05 20:54:43
Submitter: mic42 Assigned to: dkf
Subsystem: 12. ByteArray Object Severity:
Priority: 5 Medium Last modified: 2005-02-10 17:29:49
Status: Closed Closed by: dkf
Resolution: Fixed Closed on: 2005-02-10 10:29:49
Version: obsolete: 8.5a2
Description:
The man page for binary scan is not consistent on its
treatment of unsigned vs signed issues.

In the general part it recommends to use masking with
0xff..., while in the specific parts for c and s format
specifiers it tells one should use expr (0x100+$val) %
0x100

A second smaller issue can be found in the description
of the 'i' format specifier:
"Note that the integers returned are signed and cannot
be represented by Tcl as unsigned values. "

since Tcl 8.4 with wide() its untrue, as we have a
larger datatype than the signed 32-bit int.

Michael
User Comments:
dkf added on 2005-02-09 21:12:33:
Logged In: YES 
user_id=79902

The "unsigned" problem is still there; [binary scan] can
read wide values...

dkf added on 2005-02-10 17:29:49:
Logged In: YES 
user_id=79902

Tidied up; docs are now consistent about how to strip the
sign and don't claim that it is impossible to represent an
unsigned 32-bit quantity.