format bugs on P4's and AMD64's
Closed / Invalid1468858fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2006-04-11 21:13:00
Trying to do some basic calculations with expr and format is barfing on the first run and working on subsequent on a P4: tcl>set prefix 0x03000000 tcl>set mask 0xff000000 tcl>set j [expr $prefix | ~$mask+1] tcl>set last [format 0x%08x $j] Error: tcl>set last [format 0x%08x $j] tcl>set last [format 0x%08x $j] tcl>set last [format 0x%08x $j] This is on an AMD64: tcl>set prefix 0x03000000 tcl>set mask 0xff000000 tcl>set j [expr $prefix | ~$mask+1] tcl>set last [format 0x%08x $j] tcl>puts $last 0xffffffff03000000 This is on a P3 tcl>set prefix 0x03000000 tcl>set mask 0xff000000 tcl>set j [expr $prefix | ~$mask+1] tcl>set last [format 0x%08x $j] Error: tcl>set last [format 0x%08x $j] tcl>puts $last 0x03000000 This is with default redhat packages.
hobbs Pending ticket [1468858fff].
[History diff]2006-04-12 04:39:07
hobbsplain2006-04-12 04:39:08
Logged In: YES user_id=72656 What version of Tcl was this with? I cannot repro the problem on AMD64 and P4 using SuSE 9.2 on both, either in 8.4 or 8.5.
kingbrianplain2006-04-12 04:47:31
Logged In: YES user_id=1500042 This is on FC3 with tcl-8.4.7-2
hobbsplain2006-04-12 04:50:58
Logged In: YES user_id=72656 Please retest with the head (8.4.13) or you can grab ActiveTcl 8.4.12 at http://www.activestate.com/ for a quick test.
dgpplain2006-04-12 10:06:55
Logged In: YES user_id=80530 It's a bit difficult to follow the original report (some pasting errors?), but it looks like the issue is whether 0x03000000 or 0xffffffff03000000 is the correct result of [format 0x%08x -4244635648] ? The answer is that the correct result is platform-dependent and varies depending on the value of ::tcl_platform(wordSize), I think. Which result do you want your script to produce portably?
sf-robotplain2006-04-26 09:20:27
Logged In: YES user_id=1312539 This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).
Log in (anonymous is fine) to add a comment.