Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2009-01-04
02:18 • Closed ticket [2373594fff]: scan %i shuns 0b plus 7 other changes artifact: decf3e758d user: ferrieux
2008-12-02
04:29 • Add attachment scani.patch to ticket [2373594fff] artifact: 62d466b371 user: ferrieux
04:29 • Ticket [2373594fff] scan %i shuns 0b status still Open with 4 other change... artifact: c09fca01b6 user: ferrieux
2008-12-01
21:29 • New ticket [2373594fff]. artifact: e085f7e54f user: ferrieux

[scan %i] shuns 0b

Closed / Wont Fix2373594fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2008-12-01 21:29:55
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.
ferrieuxplain2008-12-02 04:29:55
File Added - 303651: scani.patch
ferrieuxplain2009-01-04 02:18:22
Backwards compatibility issues completely freeze the ancient %i.
Closing as Won't Fix.
Log in (anonymous is fine) to add a comment.

Attachments: