Artifacts Associated With Ticket 1600214fffffffffffffffffffffffffffffffff
Ticket change [7f262a4b95] (rid 97528) by nobody on 2006-11-21 07:46:38:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Below is the sample tcl script that I tested. set TclVar1 0x80000001; set TclVar2 -2147483647; set TclFlag 1; if [ $TclVar1 == $TclVar2 ] { set TclFlag 1; } else { set TclFlag 0; } The problem is: If I use Tcl8.3.2 and run in Solaris8 and AIX4.3, it will return TclFlag with value 1 which means that variable TclVar1 is equal to TclVar2. But If I use Tcl8.4.12 and run in the same Solaris8 and AIX4.3, it will return different results, that is variable TclVar1's value is 1 in AIX, but TclVar2's value is 0 in Solaris. Why? Is it a bug in updating from Tcl8.3.2 to Tcl8.4.12 or anyone can explain this? Thanks! - foundin initialized to: "obsolete: 8.4.12"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "None"
- title initialized to:
why execute the same script in Solaris and AIX is different?
- type initialized to: "Bug"
Ticket change [467583c59d] (rid 99526) by dkf on 2006-11-21 16:44:55:
- assignee changed to: "dgp"
- subsystem changed to: "47. Bytecode Compiler"
Ticket change [b7dfe83d35] (rid 128874) by dgp on 2006-11-22 00:07:44:
- closedate changed to: "2006-11-21T17:07:44"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 Originator: NO Tcl 8.4.0 added "wide" integers back in 2002, and when they came in, some of the rules for interpreting the value of literals changed to support them. In this case, the literal "0x80000001" now means "2147483649" and not "-2147483647". See TIP 72 for details. This is entirely a Tcl 8.3 -> 8.4 change. Platform switch has nothing to do with it in this case. See these interactive sessions on one system: % info patch 8.3.5 % set x 0x80000001 0x80000001 % set y -2147483647 -2147483647 % expr {$x==$y} 1 % info patch 8.4.15 % set x 0x80000001 0x80000001 % set y -2147483647 -2147483647 % expr {$x==$y} 0 Please note that your code has never been portable to a 64-bit system: % info patch 8.3.5 % set x 0x80000001 0x80000001 % set y -2147483647 -2147483647 % expr {$x==$y} 0 The only portable way to limit integer values exactly to a 32-bit range in [expr] is with masking: % expr {($x&0xFFFFFFFF)==($y&0xFFFFFFFF)} 1 Alternatively, you might want to [binary format] your values and compare the resulting byte sequences, if that's the comparison you're really trying to accomplish. % set bx [binary format i $x] % set by [binary format i $y] % expr {$bx eq $by} 1 - login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- subsystem changed to: "48. Number Handling"
- username: "dgp"
Ticket change [b319e6770e] (rid 98460) by nobody on 2006-11-30 08:53:18:
- icomment:
Logged In: NO Thanks Don Porter, I got it!
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment: