Skip to content
Tcl Source Code History Of Ticket 1600214
Login

History Of Ticket 1600214

Artifacts Associated With Ticket 1600214

  1. Ticket change [7f262a4b95] (rid 97528) by nobody on 2006-11-21 07:46:38:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. 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!
      
      
      
    4. foundin initialized to: "obsolete: 8.4.12"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "nobody"
    10. subsystem initialized to: "None"
    11. title initialized to:
      why execute the same script in Solaris and AIX is different?
      
    12. type initialized to: "Bug"
  2. Ticket change [467583c59d] (rid 99526) by dkf on 2006-11-21 16:44:55:

    1. assignee changed to: "dgp"
    2. subsystem changed to: "47. Bytecode Compiler"
  3. Ticket change [b7dfe83d35] (rid 128874) by dgp on 2006-11-22 00:07:44:

    1. closedate changed to: "2006-11-21T17:07:44"
    2. closer changed to: "dgp"
    3. 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
      
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. subsystem changed to: "48. Number Handling"
    9. username: "dgp"
  4. Ticket change [b319e6770e] (rid 98460) by nobody on 2006-11-30 08:53:18:

    1. icomment:
      Logged In: NO 
      
      Thanks Don Porter, I got it!
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"