Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6ef2c0b8e974076510e4331c245c33030f169a46
Ticket: 218136ffffffffffffffffffffffffffffffffff
Found 3 const char */char * conflicts in tclUnixFCmd.c
User & Date: nobody on 2000-10-26 00:53:35
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 2054 Bug
    Version: 8.1b3
    SubmitDate: '1999-05-12'
    LastModified: '1999-09-15'
    Severity: CRIT
    Status: Closed
    Submitter: pat
    ChangedBy: hobbs
    OS: Other
    OSVersion: UNICOS 10.0.0.2 & 10.0.0.3
    Machine: NA
    FixedDate: '2000-10-25'
    ClosedDate: '1999-09-15'
    
    
    Name:
    
    Richard Paynter
    
    
    CustomShell:
    
    Modified tclUnixFCmd.c as shown above.
    
    
    ReproducibleScript:
    
    Modified lines 373, 378, and 385, as shown below due to fatal
    
        assignments.
    
    
        373: length = readlink(src, link, sizeof(link)); ==> length = \
    
                readlink((char *)src, link, sizeof(link))
    
    
        378: if (symlink(link, dst) < 0) { ==> if (symlink(link, (char *)dst) <
    
        0) {
    
    
        385: if (mknod(dst, srcStatBuf.st_mode, ==> if (mknod((char *)dst, \
    
                srcStatBuf.st_mode,
    
    
    ObservedBehavior:
    
    Compilation aborted on these lines, until I explicitly typecast src and
    
        dst as
    
        (char *), rather than leaving them as (const char *)
    
    
    DesiredBehavior:
    
    Successful compilation of tclUnixFCmd.c
    
    
    Patch:
    
    *** tclUnixFCmd.c.old   Wed May 12 14:21:02 1999
    
    --- tclUnixFCmd.c       Wed May 12 14:15:55 1999
    
    ***************
    
    *** 370,381 ****
    
                char link[MAXPATHLEN];
    
                int length;
    
    
    !           length = readlink(src, link, sizeof(link)); /* INTL: Native. */
    
                if (length == -1) {
    
                    return TCL_ERROR;
    
                }
    
                link[length] = '\0';
    
    !           if (symlink(link, dst) < 0) {               /* INTL: Native. */
    
                    return TCL_ERROR;
    
                }
    
                break;
    
    --- 370,381 ----
    
                char link[MAXPATHLEN];
    
                int length;
    
    
    !           length = readlink((char *)src, link, sizeof(link)); /* INTL: Native.
    
     */
    
                if (length == -1) {
    
                    return TCL_ERROR;
    
                }
    
                link[length] = '\0';
    
    !           if (symlink(link, (char *)dst) < 0) {               /* INTL: Native.
    
     */
    
                    return TCL_ERROR;
    
                }
    
                break;
    
    ***************
    
    *** 382,388 ****
    
            }
    
              case S_IFBLK:
    
              case S_IFCHR: {
    
    !           if (mknod(dst, srcStatBuf.st_mode,          /* INTL: Native. */
    
                        srcStatBuf.st_rdev) < 0) {
    
                    return TCL_ERROR;
    
                }
    
    --- 382,388 ----
    
            }
    
              case S_IFBLK:
    
              case S_IFCHR: {
    
    !           if (mknod((char *)dst, srcStatBuf.st_mode,          /* INTL: Native.
    
     */
    
                        srcStatBuf.st_rdev) < 0) {
    
                    return TCL_ERROR;
    
                }
    
    
    PatchFiles:
    
    tclUnixFCmd.c
    
    
    
    
    This looks to be a compiler/system bug, because looking at
    Linux, Solaris and IRIX, they all define this to be a
    const char *. 
    -- 09/15/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.1b3"
  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: "69. Other"
  10. title changed to:
    Found 3 const char */char * conflicts in tclUnixFCmd.c
    
  11. type changed to: "Bug"