Overview
| Artifact ID: | 6ba3476db8eb984231d4d8a733a115d9d6b10cf2 |
|---|---|
| Ticket: | cd29ba23cc373c087f14305c3a3135d797ac4ac5
scan %i |
| User & Date: | beric on 2016-10-05 07:32:18 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
According to the documentation, <i>%i scans an integer with the base (i.e. decimal, binary, octal, or hexadecimal) determined in the same fashion as described in expr.</i> So one can expect: <pre> scan 0b10 %i v ;# v = 2 expected, but is 0 scan 0o77 %i v ;# v = 63 expected, but is 0 </pre> Also note that: <pre> scan 0xf %i v ;# v = 15 scan 077 %i v ;# v = 63 </pre> The test scan-4.41 in scan.test, line 337 is also buggy: <pre> test scan-4.41 {Tcl_ScanObjCmd, base-unknown integer scanning} -setup { set x {} } -body { list [scan {10 010 0x10 0b10} {%i%i%i%i} x y z t] $x $y $z $t } -result {4 10 8 16 0} </pre> The flag TCL_PARSE_SCAN_PREFIXES set in tclScan.c for %i is documented as <i>ignore prefixes</i> in tclStrToD.c. - foundin changed to: "8.6.6"
- is_private changed to: "0"
- login: "beric"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Critical"
- status changed to: "Open"
- submitter changed to: "beric"
- subsystem changed to: "23. [scan]"
- title changed to: "scan %i"
- type changed to: "Bug"