[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:
- scani.patch [download] added by ferrieux on 2008-12-02 04:29:55. [details]