Skip to content
Tcl Source Code History Of Ticket 218300
Login

History Of Ticket 218300

Artifacts Associated With Ticket 218300

  1. Ticket change [81abfb6416] (rid 117081) by nobody on 2000-10-26 00:55:54:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 3650 Bug
      Version: 8.2.2
      SubmitDate: '1999-11-23'
      LastModified: '1999-12-03'
      Severity: MED
      Status: Closed
      Submitter: techsupp
      ChangedBy: hobbs
      OS: HP-UX
      OSVersion: HP-UX B 10.20
      Machine: HP 9000/782
      FixedDate: '2000-10-25'
      ClosedDate: '1999-12-03'
      
      
      TclPro Tcl 1.3 Bug
      
      Name:  Charles Gilman
      email:  [email protected]
      Support:  Update
      Severity:  2
      OperatingSystem:  HP-UX
      Synopsis:  UPDATE TO BUG REPORT: Tcl_EvalFile does not return a value to interp->result.
      
      Comments:
      This is an update to my bug report pf 11/15/99 (no reference number).
      
      I have discovered that I was using the depricated construct interp->result. I should have been using
      the function Tcl_GetStringResult(interp). However, I have not found any documentation except under
      the man page for Tcl_GetStringResult that says that interp->result was depricated. I could find
      no information in the release notes or on the Addison Weslet Web Site for the "Tcl and the Tk
      Toolkit" book indicating that direct access to the interpreter result was discouraged. 
      
      Name:
      Charles Gilman
      
      Comments:
      The expected output was generated when the the program was compiled and linked
      with tcl7.6.
      
      The TCL library in TCLPro 1.3 is tcl8.2
      
      ReproducibleScript:
      This is from chapter 30.1 and 30.2 of TCL and the Tk Toolkit by Ousterhout (modified with some printf commands.
      
      The input file to this program contains a single TCL line: "eq 1 1"
      
      #include <stdio.h>
      #include "tcl.h"
      
      int EqCmd(ClientData clientData,
        Tcl_Interp *interp,
        int argc,
        char **argv)
      {
          if (argc != 3) {
      interp->result = "wrong # args";
      return TCL_ERROR;
          }
          if ( strcmp(argv[1], argv[2]) == 0 ) {
      interp->result = "1";
          }
          else {
      interp->result = "0";
          }
          printf("EQ Result:%s:\n",interp->result);
          return TCL_OK;
      }
      
      main (int argc, char **argv)
      {
          Tcl_Interp *interp;
          int code;
      
          if (argc != 2) {
      fprintf(stderr, "Wrong # arguments: ");
      fprintf(stderr, "should be \"%s fileName\"\n",
      argv[0]);
      exit(1);
          }
          interp = Tcl_CreateInterp();
      
          Tcl_CreateCommand(interp, 
            "eq", 
            EqCmd,
            (ClientData) NULL, 
            (Tcl_CmdDeleteProc *) NULL);
      
          code = Tcl_Eval(interp, "set q 44");
          printf("Main Result:%s:\n",interp->result);
          if (*interp->result != 0) {
      printf("Result: %s\n", interp->result);
          }
          if (code != TCL_OK) {
      printf("TCL_ERROR\n");
      exit(1);
          }
      
          code = Tcl_Eval(interp, "eq 34 34");
          printf("Main Result:%s:\n",interp->result);
          if (*interp->result != 0) {
      printf("Result: %s\n", interp->result);
          }
          if (code != TCL_OK) {
      printf("TCL_ERROR\n");
      exit(1);
          }
      
          code = Tcl_EvalFile(interp, argv[1]);
          printf("Main Result:%s:\n",interp->result);
          if (*interp->result != 0) {
      printf("Result: %s\n", interp->result);
          }
          if (code != TCL_OK) {
      printf("TCL_ERROR\n");
      exit(1);
          }
      
          exit(0);
      }
      #include <stdio.h>
      #include "tcl.h"
      
      int EqCmd(ClientData clientData,
        Tcl_Interp *interp,
        int argc,
        char **argv)
      {
          if (argc != 3) {
      interp->result = "wrong # args";
      return TCL_ERROR;
          }
          if ( strcmp(argv[1], argv[2]) == 0 ) {
      interp->result = "1";
          }
          else {
      interp->result = "0";
          }
          printf("EQ Result:%s:\n",interp->result);
          return TCL_OK;
      }
      
      ObservedBehavior:
      The program out put is a follows. This output shoes that Tcl_Eval(interp, "eq 1 1")
      prodices the correct result  and Tcl_Eval_File(interp, argv[1]) does not. 
      
      %a.out test.tcl
      Main Result:44:
      Result: 44
      EQ Result:1:
      Main Result:1:
      Result: 1
      EQ Result:1:
      Main Result::
      
      DesiredBehavior:
      This is the output I expected to see.
      
      %a.out test.tcl
      Main Result:44:
      Result: 44
      EQ Result:1:
      Main Result:1:
      Result: 1
      EQ Result:1:
      Main Result:1:
      Result: 1
      
      
      
      The AW book mentioned (by Ousterhout) is *ancient*, I would
      recommend the 3rd edition from Welch, which includes porting
      notes in the appendices.  Use of inter->result is indeed
      deprecated, although we still need to fix some of our docs. 
      -- 12/03/1999 hobbs
      
    4. foundin initialized to: "obsolete: 8.2.2"
    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: "69. Other"
    10. title initialized to:
      Tcl_EvalFile does not return a value to interp->result.
      
    11. type initialized to: "Bug"
  2. Ticket change [95707c8f32] (rid 106156) by welch on 2000-10-26 08:18:59:

    1. closedate changed to: "2000-10-26T01:18:59"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [4e648ca4e1] (rid 127225) by dgp on 2001-04-19 04:32:49:

    1. closedate changed to: "2001-04-18T21:32:49"
    2. closer changed to: "dgp"
    3. resolution changed to: "Invalid"
    4. subsystem changed to: "45. Parsing and Eval"