Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fb8b4e72456f10b8095cd70807867e38179a8f4e
Ticket: 218651ffffffffffffffffffffffffffffffffff
Tcl doesn't compile on OS/390, since enums are no int
User & Date: nobody on 2000-10-26 01:03:42
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 1592 Bug
    Version: 8.1b2
    SubmitDate: '1999-03-22'
    LastModified: '1999-03-26'
    Severity: MED
    Status: Released
    Submitter: pat
    ChangedBy: rjohnson
    OS: Other
    OSVersion: OS/390 4.0
    Machine: NA
    FixedDate: '1999-03-26'
    FixedInVersion: 8.1b3
    ClosedDate: '2000-10-25'
    
    
    Name:
    
    Christian Krone
    
    
    
    Extensions:
    
    Expect 5.28
    
    
    
    ReproducibleScript:
    
        Compilation errors on OS/390 for:
    
        - generic/tclCmdIL.c,
    
        - generic/tclIOCmd.c and
    
        - generic/tclNamesp.c
    
        
    
        
    
    
    
    
    
    
    
    ObservedBehavior:
    
        The OS/390 compiler packs enums as small as possible.
    
        Those enums having less than 257 elements are put into a single
    
        byte. Unfortunately, Tcl uses addresses of enum-Variables as
    
        function arguments, where addresses of integers are expected!
    
        Fortunately, Tk does not, and even Tcl sometimes does this
    
        correctly: passing the address of an integer variable and
    
        comparing it against enumerated values later on.
    
        
    
    
    
    
    
    
    
    DesiredBehavior:
    
        With the patch below applied Tcl will compile smoothly,
    
        even on a "normal" Unix system.
    
        
    
    
    
    
    
    
    
    Patch:
    
    *** generic/tclCmdIL.c.orgMon Mar 22 18:57:51 1999
    
    --- generic/tclCmdIL.cMon Mar 22 19:03:18 1999
    
    ***************
    
    *** 375,381 ****
    
          IHostnameIdx, ILevelIdx, ILibraryIdx, ILoadedIdx,
    
          ILocalsIdx, INameOfExecutableIdx, IPatchLevelIdx, IProcsIdx,
    
          IScriptIdx, ISharedLibExtensionIdx, ITclVersionIdx, IVarsIdx
    
    !     } index;
    
          int result;
    
      
    
          if (objc < 2) {
    
    --- 375,382 ----
    
          IHostnameIdx, ILevelIdx, ILibraryIdx, ILoadedIdx,
    
          ILocalsIdx, INameOfExecutableIdx, IPatchLevelIdx, IProcsIdx,
    
          IScriptIdx, ISharedLibExtensionIdx, ITclVersionIdx, IVarsIdx
    
    !     };
    
    !     int index;
    
          int result;
    
      
    
          if (objc < 2) {
    
    ***************
    
    *** 389,395 ****
    
      return result;
    
          }
    
      
    
    !     switch (index) {
    
              case IArgsIdx:
    
          result = InfoArgsCmd(clientData, interp, objc, objv);
    
                  break;
    
    --- 390,396 ----
    
      return result;
    
          }
    
      
    
    !     switch ((enum ISubCmdIdx) index) {
    
              case IArgsIdx:
    
          result = InfoArgsCmd(clientData, interp, objc, objv);
    
                  break;
    
    *** generic/tclIOCmd.c.orgMon Mar 22 18:59:37 1999
    
    --- generic/tclIOCmd.cMon Mar 22 19:03:14 1999
    
    ***************
    
    *** 1478,1484 ****
    
          int toRead;
    
          Tcl_Obj *cmdPtr;
    
          static char* switches[] = { "-size", "-command", NULL };
    
    !     enum { FcopySize, FcopyCommand } index;
    
      
    
          if ((objc < 3) || (objc > 7) || (objc == 4) || (objc == 6)) {
    
      Tcl_WrongNumArgs(interp, 1, objv,
    
    --- 1478,1485 ----
    
          int toRead;
    
          Tcl_Obj *cmdPtr;
    
          static char* switches[] = { "-size", "-command", NULL };
    
    !     enum option { FcopySize, FcopyCommand };
    
    !     int index;
    
      
    
          if ((objc < 3) || (objc > 7) || (objc == 4) || (objc == 6)) {
    
      Tcl_WrongNumArgs(interp, 1, objv,
    
    ***************
    
    *** 1521,1527 ****
    
      (int *) &index) != TCL_OK) {
    
          return TCL_ERROR;
    
      }
    
    ! switch (index) {
    
          case FcopySize:
    
      if (Tcl_GetIntFromObj(interp, objv[i+1], &toRead) != TCL_OK) {
    
          return TCL_ERROR;
    
    --- 1522,1528 ----
    
      (int *) &index) != TCL_OK) {
    
          return TCL_ERROR;
    
      }
    
    ! switch ((enum option) index) {
    
          case FcopySize:
    
      if (Tcl_GetIntFromObj(interp, objv[i+1], &toRead) != TCL_OK) {
    
          return TCL_ERROR;
    
    *** generic/tclNamesp.c.orgMon Mar 22 19:01:03 1999
    
    --- generic/tclNamesp.cMon Mar 22 19:03:11 1999
    
    ***************
    
    *** 2438,2444 ****
    
          NSEvalIdx, NSExportIdx, NSForgetIdx, NSImportIdx,
    
          NSInscopeIdx, NSOriginIdx, NSParentIdx, NSQualifiersIdx,
    
          NSTailIdx, NSWhichIdx
    
    !     } index;
    
          int result;
    
      
    
          if (objc < 2) {
    
    --- 2438,2445 ----
    
          NSEvalIdx, NSExportIdx, NSForgetIdx, NSImportIdx,
    
          NSInscopeIdx, NSOriginIdx, NSParentIdx, NSQualifiersIdx,
    
          NSTailIdx, NSWhichIdx
    
    !     };
    
    !     int index;
    
          int result;
    
      
    
          if (objc < 2) {
    
    ***************
    
    *** 2456,2462 ****
    
      return result;
    
          }
    
          
    
    !     switch (index) {
    
              case NSChildrenIdx:
    
          result = NamespaceChildrenCmd(clientData, interp, objc, objv);
    
                  break;
    
    --- 2457,2463 ----
    
      return result;
    
          }
    
          
    
    !     switch ((enum NSSubCmdIdx) index) {
    
              case NSChildrenIdx:
    
          result = NamespaceChildrenCmd(clientData, interp, objc, objv);
    
                  break;
    
    
    
    
    
    
    
    
    
    PatchFiles:
    
        tclCmdIL.c
    
        tclIOCmd.c
    
        tclNamesp.c
    
        
    
        
    
    
    
    
    
    
    
    Done.  03/26/1999 19:16 - rjohnson -
    
  4. foundin changed to: "obsolete: 8.1b2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "10. Objects"
  10. title changed to:
    Tcl doesn't compile on OS/390, since enums are no int
    
  11. type changed to: "Bug"