Skip to content
Tcl Source Code History Of Ticket 1241572
Login

History Of Ticket 1241572

Artifacts Associated With Ticket 1241572

  1. Ticket change [c3e94555a4] (rid 111753) by nobody on 2005-07-20 13:52:06:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      % set x -2147483647; expr {abs($x)}
      2147483647
      % set x -2147483648; expr {abs($x)}
      integer value too large to represent
      % set x -2147483649; expr {abs($x)}
      2147483649
      
      This is a practical problem as we use -2147483648 
      (0x80000000, MIN_INT) to express missing data.
      
      Seen in 8.4.1 and 8.5a2 Tclkit, Windows XP and Linux.
      
      [email protected]
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "11. Conversions from String"
    10. title initialized to: "[expr] blind spot at corner of 32/64 bit integers"
    11. type initialized to: "Bug"
  2. Ticket change [1c7a0e4709] (rid 90612) by dkf on 2005-07-20 21:05:29:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Problem is it that it hits the "FIXME" case in ExprAbsFunc
      (in tclBasic.c in the HEAD.)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Ticket change [a5885f4afb] (rid 110391) by hobbs on 2005-07-21 00:20:25:

    1. assignee changed to: "kennykb"
  4. Ticket change [31a6d8f197] (rid 93468) by kennykb on 2005-08-06 02:24:29:

    1. closedate changed to: "2005-08-05T19:24:29"
    2. closer changed to: "kennykb"
    3. icomment:
      Logged In: YES 
      user_id=99768
      
      Right you are.  Although in 8.4.11, you have to do
      expr {int(-2147483648)} to tickle the bug.  Anyway, abs()
      is fixed.
      
      
    4. login: "kennykb"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "kennykb"
  5. Ticket change [ffb154fd37] (rid 108796) by rmax on 2005-12-10 00:32:22:

    1. icomment:
      Logged In: YES 
      user_id=124643
      
      This fix depends on implementation defined behaviour of the
      compiler and fails with gcc 4.1.0. What happens is, that the
      compiler decides that the negation of a negative number can
      never have a negative result, and so it optimizes away the
      special case for INT_MIN as dead code.
      
      There are two solutions for this: either rewriting the code
      so that it doesn't depend on the assumption that -MIN_INT ==
      MIN_INT, or use the -fwrapv parameter to gcc, so that it
      guarantees the wrapping behaviour of integers.
      
      See also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25329
      
      
    2. login: "rmax"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "rmax"
  6. Ticket change [1a818dff66] (rid 122986) by rmax on 2005-12-10 00:39:50:

    1. resolution changed to: "None"
  7. Add attachment "tcl-abs.patch" [eafb67e55a] (rid 103461) by rmax on 2005-12-10 01:13:03.

  8. Ticket change [8ed4d683b7] (rid 120180) by rmax on 2005-12-10 01:13:03:

    1. icomment:
      
      
      File Added - 159278: tcl-abs.patch
      
      
      
    2. login: "rmax"
    3. mimetype: "text/plain"
    4. username: "rmax"
  9. Ticket change [426a77ab2a] (rid 116376) by nobody on 2005-12-12 17:38:51:

    1. icomment:
      Logged In: NO 
      
      Hmm - my patch fixes 32bit platform, but it breaks 64bit :(
      
      How about using MIN_INT from limits.h for checking this
      special case, and providing compatibility definitions for
      platforms that don't have limits.h?
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  10. Ticket change [632f38091c] (rid 92534) by rmax on 2005-12-12 18:38:40:

    1. closedate changed to: "2005-12-12T11:38:40"
    2. closer changed to: "rmax"
    3. icomment:
      Logged In: YES 
      user_id=124643
      
      I just committed the attached patch to the 8.4 branch.
      
      It assumes that MIN_LONG is defined by one of the headers
      that are being included already. If there is any platform
      where this isn't true, a compatibility definition needs to
      be added.
      
      
    4. login: "rmax"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "rmax"
  11. Add attachment "tcl-abs.patch" [7085940e42] (rid 100494) by rmax on 2005-12-12 18:38:41.

  12. Ticket change [8e9a85e96a] (rid 120139) by rmax on 2005-12-12 18:38:42:

    1. icomment:
      
      
      File Added - 159527: tcl-abs.patch
      
      
      
    2. login: "rmax"
    3. mimetype: "text/plain"
    4. username: "rmax"