Artifacts Associated With Ticket 991371ffffffffffffffffffffffffffffffffff
Ticket change [1df2c999f4] (rid 90893) by bgriffin on 2004-07-15 05:59:38:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The format command errors out on %d of a wide int, but than converts the wide int to int so that subsequent format works without error. Place the following in a file "format_bug.tcl": set x [file size format_bug.tcl] puts stdout "First format:" if {[catch {format "%d bytes" $x} res]} { puts stdout "Error: $res\nTrace back: $errorInfo" } else { puts stdout $res } puts stdout "Second format:" if {[catch {format "%d bytes" $x} res]} { puts stdout "Error: $res\nTrace back: $errorInfo" } else { puts stdout $res } Running the above code produces: First format: Error: Trace back: while executing "format "%d bytes" $x" Second format: 337 bytes - foundin initialized to: "obsolete: 8.4.6"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "bgriffin"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "format problem with wide ints"
- type initialized to: "Bug"
Ticket change [9ce4a0c070] (rid 96222) by bgriffin on 2004-07-15 13:01:14:
- icomment:
Logged In: YES user_id=22949 I forgot to mention: This fails on 64-bit Solaris.
- login: "bgriffin"
- mimetype: "text/plain"
- username: "bgriffin"
- icomment:
Ticket change [959bf6ab95] (rid 106184) by hobbs on 2004-07-16 01:34:02:
- icomment:
Logged In: YES user_id=72656 This appears to be related to bug 699060 fixed in the 8.5 head. It needs to be backported as it clearly breaks on 8.4 (not all 64-bit plats, but something is wrong).
- login: "hobbs"
- mimetype: "text/plain"
- priority changed to: "8"
- username: "hobbs"
- icomment:
Ticket change [e62944ba7d] (rid 104251) by dgp on 2004-07-16 04:47:31:
- icomment:
Logged In: YES user_id=80530 Report 699060 claims the fix went into Tcl 8.4.3 .
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [c7bef9744e] (rid 121992) by hobbs on 2004-07-16 04:51:38:
- icomment:
Logged In: YES user_id=72656 It may, and 702622 appears to be in 8.4 as well, but that doesn't discount the fact that %[duxX] have different code between 8.4 and the head - there are no ChangeLog docs to really indicate why they should be so separate.
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [f01575c434] (rid 109116) by dgp on 2004-07-16 05:22:19:
- icomment:
Logged In: YES user_id=80530 Is this bug present in Tcl 8.4.2 ?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [f4a99c1150] (rid 129957) by hobbs on 2004-07-16 11:31:53:
- icomment:
Logged In: YES user_id=72656 I found that this: - if (wideValue>ULONG_MAX || wideValue<LONG_MIN) { + if (wideValue>LONG_MAX || wideValue<LONG_MIN) { at line 2209 of tclCmdAH.c:Tcl_FormatObjCmd made it work on Solaris-64, which indicates a sign extension bug in the compiler. Note that the above fix isn't actually correct code for this case (although I wonder whether we should be mingling unsigned checks for %d as well as the %[uoxX] this case covers). Also, a shorter test case is: et x [expr {wide(1)}] set code [catch {format "%d bytes" $x} res] puts "1st format ($code): $res" set code [catch {format "%d bytes" $x} res] puts "2nd format ($code): $res" - login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [4b4fec1e69] (rid 126684) by bgriffin on 2004-07-16 12:21:53:
- icomment:
Logged In: YES user_id=22949 Compiler bugs aside, I question why isn't %d automatically promoted to %ld if/when Obj is a Wide int? Otherwise, tcl programmers are forced to concern themselves with type in a "typeless" language. This doesn't seem right to me. See, if the wide int was actually indeed larger than LONG_MAX (>32- bits) then an error would have been produced legitimately. This means at the tcl level one must concern themselves with %d vs %ld. But these notions were invented to deal with different types (int vs long). Tcl is not supposed to be "typed".
- login: "bgriffin"
- mimetype: "text/plain"
- username: "bgriffin"
- icomment:
Ticket change [4982e38e9e] (rid 100065) by dkf on 2004-08-04 03:37:25:
- icomment:
Logged In: YES user_id=79902 There are altogether too many ways for me to list right now in which I'm not satisfied with the current handling of 64-bit values on 32-bit platforms. This is *not* the most surprising of them. :^(
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [a91d1f8f3f] (rid 99103) by dkf on 2004-09-11 05:39:07:
- status changed to: "Closed"
Ticket change [c9d5bcc3dc] (rid 122355) by dkf on 2004-09-11 05:39:08:
- closedate changed to: "2004-09-10T22:39:08"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 The fix for Bug 868489 seems to have cleared this up as well (or at least it all works for me now I've patched that.)
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- username: "dkf"