Skip to content
Tcl Source Code History Of Ticket 474335ffffffffff
Login

History Of Ticket 474335ffffffffff

Artifacts Associated With Ticket 474335ffffffffff

  1. Ticket change [a6b65768b1] (rid 98654) by dgp on 2001-10-24 03:45:18:

    1. assignee initialized to: "mdejong"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      A simple look at the cvs history of 
      unix/tclMtherr.c shows the introduction of
      a bug:
      
      cvs diff -r core-8-0-5 -r core-8-1-0 tclMtherr.c
      ...
      matherr(xPtr)
           struct exception *xPtr;    /* Describes error that
      occurred. */
       {
      -    if (!tcl_MathInProgress) {
      +    if (TclMathInProgress()) {
              return 0;
      ...
      
      The "!" did not survive the transition from
      access of a global variable to call of an internal
      function.  The logic of matherr() became reversed.
      The obvious fix is to restore the proper logic.
      
      It's worth pausing though and asking why this
      bug hasn't been noticed in the 3 years since it
      was introduced.  I am unable to come up with
      any script on any platform that exposes this error.
      
      It seems that Tcl behaves the same whether the
      logic is forwards or backwards.
      It would seem then that Tcl would also behave the
      same if the logic were completely removed.  I welcome
      second opinions on this, but my inclination would
      be to remove the matherr() routine altogether
      unless someone can demonstrate it's serving a
      useful purpose somewhere.  (And how useful can
      it be if it's been wrong since Tcl 8.1.0 ?)
      
      
    4. foundin initialized to: "obsolete: 8.4a4"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dgp"
    9. subsystem initialized to: "52. Portability Support"
    10. title initialized to: "logic of matherr is backwards"
    11. type initialized to: "Bug"
  2. Ticket change [5534652d2b] (rid 94090) by hobbs on 2001-10-25 02:42:07:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      And note that win/tclWinMtherr.c actually has the correct ! 
      in that compat function.  Note that it is a compat 
      function.  You'd like have to ask the older core guys 
      (JohnO or Brian Lewis who did the original compiler) 
      directly if/what meaning this had.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  3. Ticket change [e33b93f53c] (rid 87757) by hobbs on 2001-10-25 02:43:24:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      Of course, the comments for the Windows version say only 
      Borland C++ uses it.  However, that should be verified, as 
      that used to be the official compiler of the sources, and 
      the comment may be incorrect.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  4. Ticket change [02b251e919] (rid 119689) by dgp on 2001-10-25 03:13:31:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Agreed that second opinions from the old-timers
      will be very helpful.
      
      I also note, that matherr() and _matherr() are the
      only callers of TclMathInProgress() so if they go,
      so can that.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [86568000b3] (rid 131492) by mdejong on 2002-01-12 01:56:38:

    1. assignee changed to: "hobbs"
    2. icomment:
      Logged In: YES 
      user_id=90858
      
      I don't have anything useful to add, assigning this
      bug back to hobbs.
      
      
    3. login: "mdejong"
    4. mimetype: "text/plain"
    5. username: "mdejong"
  6. Ticket change [956cb386f9] (rid 106153) by jenglish on 2002-01-16 09:21:46:

    1. icomment:
      Logged In: YES 
      user_id=68433
      
      On the Unices that I have available, 'matherr()' is only
      used  if you statically  link against a special library
      instead of the default -lm (IRIX: -lmx; AIX: -lmsaa; Linux
      (RH 6.2, 7.0,7.1,7.2, SuSE 6.2): apparently not supported). 
      
      A google search shows that matherr is supported on HP-UX and
      a few others, but the default behaviour (set errno and
      continue) is exactly the same as  what's in
      unix/tclMtherr.c, so the latter is redundant.
      
      It would appear that this is either unused or redundant on
      all Unix platforms, and can safely be removed (except for
      one problem, see below).
      
      In unix/tclAppInit.c the following should also be taken out:
      
      /* 
       * The following variable is a special hack that is needed
      in order for
       * Sun shared libraries to be used for Tcl.
       */
      extern int matherr();
      int *tclDummyMathPtr = (int *) matherr;
      
      This bit of code has been around since Tcl 7.4, but has long
      since been rendered obsolete by Stubs and newer versions of
      SunOS.
       
      The only problem with removing unix/tclMtherr.c is that all
      the custom tclsh's and wishes out there that have retained
      the tclDummyMathPtr definition for cargo-cult reasons will
      fail to link on platforms that don't have matherr().  It's
      an easy fix -- just get rid of the definition -- so this
      probably isn't much of an issue.
      
      
      
    2. login: "jenglish"
    3. mimetype: "text/plain"
    4. username: "jenglish"
  7. Ticket change [1333b35c8d] (rid 124172) by dgp on 2002-02-20 07:59:02:

    1. assignee changed to: "dgp"
    2. priority changed to: "7 High"
  8. Ticket change [2dc6d256fe] (rid 119118) by dgp on 2002-02-20 08:25:16:

    1. assignee changed to: "davygrvy"
    2. closedate changed to: "2002-02-20T01:25:16"
    3. closer changed to: "dgp"
    4. icomment:
      Logged In: YES 
      user_id=80530
      
      davgrvy, can you comment on whether the
      _matherr() function in win/tclWinMtherr.c
      is still needed by Borland compilers?
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. status changed to: "Pending"
    8. username: "dgp"
  9. Ticket change [022a1daa1a] (rid 119598) by dgp on 2002-02-22 00:31:28:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Since Tcl 8.4 should be released soon, now is not
      the time to risk breaking anything, but as soon
      as we get a HEAD aimed at 8.5a development I plan
      to yank out all this matherr business.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "dgp"
  10. Ticket change [9e90b7d8e8] (rid 96490) by jenglish on 2002-05-14 04:50:27:

    1. icomment:
      Logged In: YES 
      user_id=68433
      
      Another data point:  On HP-UX 10.20, the function _matherr()
      is used when linking with the default math library (note
      leading underscore, NOT 'matherr()', which is what
      unix/tclMtherr.c defines).  Also, the man page says the
      following:
      
      "The matherr() and _matherr() functions are obsolete and
      will not be supported at the next release of HP-UX  [that
      would be HP-UX 11 -JE].  The matherr() function is not
      required by any version of XPG nor by ANSI C, and has not
      been part of any standard since SVID2.  In the HP-UX math
      library, the SVID2 matherr() function has been renamed to
      _matherr(), and no error messages are printed to the
      standard error output.  _matherr() is provided in libm.a in
      order to assist in supporting old programs.  Executables
      that use the old matherr() or _matherr() will continue to
      run indefinitely, even on future releases of HP-UX."
      
      "However, if you intend to recompile or relink any of your
      current programs that use matherr() or _matherr() on a
      future release of HP-UX, you should be aware that any
      function called matherr() or _matherr() will no longer be
      called in case of library errors."  
      
      
      
    2. login: "jenglish"
    3. mimetype: "text/plain"
    4. username: "jenglish"
  11. Ticket change [77efb0e5cb] (rid 89862) by davygrvy on 2002-05-28 08:19:49:

    1. icomment:
      Logged In: YES 
      user_id=7549
      
      Should this be assigned to me?  I don't know how to follow 
      this up.
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. username: "davygrvy"
  12. Ticket change [d2f715e5a4] (rid 113613) by dgp on 2002-05-28 10:50:05:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Hi, davygrvy,
      
      This was assigned to you looking for comments on
      whether the Borland compiler still had any need 
      for a matherr() implementation.  See the 2002-02-19
      comment below.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  13. Ticket change [6b464294c3] (rid 128295) by davygrvy on 2002-05-28 11:04:49:

    1. icomment:
      Logged In: YES 
      user_id=7549
      
      There are 2 mentions of it in include/math.h:
      
      struct  _exception
      {
          int type;
          char   _FAR *name;
          double  arg1, arg2, retval;
      };
      
      struct  _exceptionl
      {
          int type;
          char   _FAR *name;
          long double  arg1, arg2, retval;
      };
      
      typedef enum
      {
          DOMAIN = 1,    /* argument domain error -- log (-1)        */
          SING,          /* argument singularity  -- pow (0,-2))     */
          OVERFLOW,      /* overflow range error  -- exp (1000)      */
          UNDERFLOW,     /* underflow range error -- exp (-1000)     
      */
          TLOSS,         /* total loss of significance -- sin(10e70) */
          PLOSS,         /* partial loss of signif. -- not used      */
          STACKFAULT     /* floating point unit stack overflow       */
      }   _mexcep;
      
      int         _RTLENTRY          _matherr(struct _exception  *__e);
      int         _RTLENTRY          _matherrl(struct _exceptionl 
      *__e);
      
      I don't know what to say beyond the existence of it.  I don't 
      have any documentation on Borland's RT to contribute any 
      useful concerns.  fastmath.h says the following, though:
      
      /*
         fastmath.h - header file for the FastMath routines.  These 
      are high
                      performance math routines that don't bother 
      checking for
                      most error conditions and never call matherr.  
      They are
                      coded for maximum speed and most are written in 
      assembly.
      
                      These functions are never exported from the 
      RTLDLL, which
                      means that they always get linked directly into the 
      PE file
                      which is being created.
      
      */
      
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. username: "davygrvy"
  14. Ticket change [8a90a9e6e8] (rid 127411) by dgp on 2002-05-29 23:47:54:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      OK, thanks.  I'll stick with the plan to remove all
      the matherr stuff from Tcl once we hit 8.5a development.
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "5 Medium"
    6. username: "dgp"
  15. Ticket change [483a636ad3] (rid 99847) by jenglish on 2002-05-30 00:34:45:

    1. icomment:
      Logged In: YES 
      user_id=68433
      
      > I'll stick with the plan to remove all the matherr stuff
      from Tcl once we hit 8.5a development.
      
      Why not remove it now, while we're still in the 8.4 alpha
      series?
      
      See also patch #555635 "Dead code: matherr,
      TclMathInProgress".  This is extremely unlikely to break
      anything.  I realize that code cleanup is not a high
      priority -- "if it ain't broke, don't fix it" -- but dead
      code *does* have a cost.
      
      
    2. login: "jenglish"
    3. mimetype: "text/plain"
    4. username: "jenglish"
  16. Ticket change [1ead7ce54f] (rid 91015) by dgp on 2002-06-01 05:21:28:

    1. closedate changed to: "2002-05-31T22:21:28"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      Patch 555635 accepted in Tcl 8.4a5.  Fixed.  Closed.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dgp"