Tcl Source Code

View Ticket
Login
Ticket UUID: 2373594
Title: [scan %i] shuns 0b
Type: Bug Version: None
Submitter: ferrieux Created on: 2008-12-01 21:29:55
Subsystem: 23. [scan] Assigned To: dgp
Priority: 7 High Severity:
Status: Closed Last Modified: 2009-01-04 02:18:22
Resolution: Wont Fix Closed By: ferrieux
    Closed on: 2009-01-03 19:18:22
Description:
The %i specifier in [scan] is documented as:

"The base (i.e. decimal, binary, octal, or hexadecimal) is determined in the same fashion as described in expr."

This would seem to suggest that 0b (and possibly 0o) should be handled as 0x. It is not the case; both

  scan 0b101 %i x
  scan 0o20  %i x

store 0 in x.

This can be traced to specific avoidance of these prefixes in tclStrToD.c.

The attached patch re-establishes the 0b prefix. It is trivial to extend it to 0o, should the consensus say so.
User Comments: ferrieux added on 2009-01-04 02:18:22:
Backwards compatibility issues completely freeze the ancient %i.
Closing as Won't Fix.

ferrieux added on 2008-12-02 04:29:55:

File Added - 303651: scani.patch

Attachments: