Menu

#1590 Compile warnings on static functions

obsolete: 8.4a3
closed-fixed
5
2001-08-28
2001-08-21
No

Several compiler warnings appear when building Tcl 8.4a3 on HP-UX 10.20
using the HP cc compiler. It appears that new static function prototypes
have been added in several files, but the function definitions should also
include the 'static' keyword.

Files affected are tclCompCmds.c, tclDate.c, tclIOUtil.c, and tclTest.c.

The compiler warnings (complete with line numbers) are:

cc: "../generic/tclCompCmds.c", line 2567: warning 562: Redeclaration of "TclPushVarName" with a
different storage class specifier: "TclPushVarName" will have internal linkage.

cc: "../generic/tclDate.c", line 161: warning 562: Redeclaration of "TclDatelex" with a different
storage class specifier: "TclDatelex" will have internal linkage.

cc: "../generic/tclIO.c", line 930: warning 562: Redeclaration of "DetachChannel" with a different
storage class specifier: "DetachChannel" will have internal linkage.
cc: "../generic/tclIO.c", line 2827: warning 562: Redeclaration of "DoWriteChars" with a different
storage class specifier: "DoWriteChars" will have internal linkage.
cc: "../generic/tclIO.c", line 4278: warning 562: Redeclaration of "DoReadChars" with a different
storage class specifier: "DoReadChars" will have internal linkage.

cc: "../generic/tclIOUtil.c", line 1836: warning 562: Redeclaration of "NativeFileAttrStrings" with a
different storage class specifier: "NativeFileAttrStrings" will have internal linkage.
cc: "../generic/tclIOUtil.c", line 1868: warning 562: Redeclaration of "NativeFileAttrsGet" with a
different storage class specifier: "NativeFileAttrsGet" will have internal linkage.
cc: "../generic/tclIOUtil.c", line 1900: warning 562: Redeclaration of "NativeFileAttrsSet" with a
different storage class specifier: "NativeFileAttrsSet" will have internal linkage.
cc: "../generic/tclIOUtil.c", line 3333: warning 562: Redeclaration of "NativeCreateNativeRep" with a
different storage class specifier: "NativeCreateNativeRep" will have internal linkage.
cc: "../generic/tclIOUtil.c", line 3414: warning 562: Redeclaration of "NativeDupInternalRep" with a
different storage class specifier: "NativeDupInternalRep" will have internal linkage.
cc: "../generic/tclIOUtil.c", line 3450: warning 562: Redeclaration of "NativePathInFilesystem" with
a different storage class specifier: "NativePathInFilesystem" will have internal linkage.
cc: "../generic/tclIOUtil.c", line 3480: warning 562: Redeclaration of "NativeFreeInternalRep" with a
different storage class specifier: "NativeFreeInternalRep" will have internal linkage.
cc: "../generic/tclIOUtil.c", line 3583: warning 562: Redeclaration of "NativeFilesystemSeparator"
with a different storage class specifier: "NativeFilesystemSeparator" will have internal linkage.
cc: "../generic/tclIOUtil.c", line 3620: warning 562: Redeclaration of "NativeFilesystemPathType"
with a different storage class specifier: "NativeFilesystemPathType" will have internal linkage.
cc: "../generic/tclIOUtil.c", line 3790: warning 562: Redeclaration of "NativeOpenFileChannel" with a
different storage class specifier: "NativeOpenFileChannel" will have internal linkage.
cc: "../generic/tclIOUtil.c", line 3814: warning 562: Redeclaration of "NativeUtime" with a different
storage class specifier: "NativeUtime" will have internal linkage.
cc: "../generic/tclIOUtil.c", line 3830: warning 562: Redeclaration of "NativeLoadFile" with a
different storage class specifier: "NativeLoadFile" will have internal linkage.

cc: "../generic/tclTest.c", line 2628: warning 562: Redeclaration of "TestregexpObjCmd" with a
different storage class specifier: "TestregexpObjCmd" will have internal linkage.
cc: "../generic/tclTest.c", line 4431: warning 562: Redeclaration of "TestChannelCmd" with a
different storage class specifier: "TestChannelCmd" will have internal linkage.
cc: "../generic/tclTest.c", line 4859: warning 562: Redeclaration of "TestChannelEventCmd" with a
different storage class specifier: "TestChannelEventCmd" will have internal linkage.
cc: "../generic/tclTest.c", line 5216: warning 562: Redeclaration of "TestReport" with a different
storage class specifier: "TestReport" will have internal linkage.
cc: "../generic/tclTest.c", line 5245: warning 562: Redeclaration of "TestReportStat" with a
different storage class specifier: "TestReportStat" will have internal linkage.
cc: "../generic/tclTest.c", line 5253: warning 562: Redeclaration of "TestReportLstat" with a
different storage class specifier: "TestReportLstat" will have internal linkage.
cc: "../generic/tclTest.c", line 5261: warning 562: Redeclaration of "TestReportAccess" with a
different storage class specifier: "TestReportAccess" will have internal linkage.
cc: "../generic/tclTest.c", line 5269: warning 562: Redeclaration of "TestReportOpenFileChannel"
with a different storage class specifier: "TestReportOpenFileChannel" will have internal linkage.
cc: "../generic/tclTest.c", line 5284: warning 562: Redeclaration of "TestReportMatchInDirectory"
with a different storage class specifier: "TestReportMatchInDirectory" will have internal linkage.
cc: "../generic/tclTest.c", line 5296: warning 562: Redeclaration of "TestReportGetCwd" with a
different storage class specifier: "TestReportGetCwd" will have internal linkage.
cc: "../generic/tclTest.c", line 5303: warning 562: Redeclaration of "TestReportChdir" with a
different storage class specifier: "TestReportChdir" will have internal linkage.
cc: "../generic/tclTest.c", line 5310: warning 562: Redeclaration of "TestReportLoadFile" with a
different storage class specifier: "TestReportLoadFile" will have internal linkage.
cc: "../generic/tclTest.c", line 5327: warning 562: Redeclaration of "TestReportUnloadFile" with a
different storage class specifier: "TestReportUnloadFile" will have internal linkage.
cc: "../generic/tclTest.c", line 5336: warning 562: Redeclaration of "TestReportReadlink" with a
different storage class specifier: "TestReportReadlink" will have internal linkage.
cc: "../generic/tclTest.c", line 5343: warning 562: Redeclaration of "TestReportListVolumes" with a
different storage class specifier: "TestReportListVolumes" will have internal linkage.
cc: "../generic/tclTest.c", line 5350: warning 562: Redeclaration of "TestReportRenameFile" with a
different storage class specifier: "TestReportRenameFile" will have internal linkage.
cc: "../generic/tclTest.c", line 5360: warning 562: Redeclaration of "TestReportCopyFile" with a
different storage class specifier: "TestReportCopyFile" will have internal linkage.
cc: "../generic/tclTest.c", line 5368: warning 562: Redeclaration of "TestReportDeleteFile" with a
different storage class specifier: "TestReportDeleteFile" will have internal linkage.
cc: "../generic/tclTest.c", line 5375: warning 562: Redeclaration of "TestReportCreateDirectory"
with a different storage class specifier: "TestReportCreateDirectory" will have internal linkage.
cc: "../generic/tclTest.c", line 5382: warning 562: Redeclaration of "TestReportCopyDirectory" with
a different storage class specifier: "TestReportCopyDirectory" will have internal linkage.
cc: "../generic/tclTest.c", line 5394: warning 562: Redeclaration of "TestReportRemoveDirectory"
with a different storage class specifier: "TestReportRemoveDirectory" will have internal linkage.
cc: "../generic/tclTest.c", line 5408: warning 562: Redeclaration of "TestReportFileAttrStrings" with
a different storage class specifier: "TestReportFileAttrStrings" will have internal linkage.
cc: "../generic/tclTest.c", line 5416: warning 562: Redeclaration of "TestReportFileAttrsGet" with a
different storage class specifier: "TestReportFileAttrsGet" will have internal linkage.
cc: "../generic/tclTest.c", line 5426: warning 562: Redeclaration of "TestReportFileAttrsSet" with a
different storage class specifier: "TestReportFileAttrsSet" will have internal linkage.
cc: "../generic/tclTest.c", line 5436: warning 562: Redeclaration of "TestReportUtime" with a
different storage class specifier: "TestReportUtime" will have internal linkage.
cc: "../generic/tclTest.c", line 5444: warning 562: Redeclaration of "TestReportNormalizePath" with
a different storage class specifier: "TestReportNormalizePath" will have internal linkage.

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2001-08-22
    • assigned_to: mdejong --> vincentdarley
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2001-08-22

    Logged In: YES
    user_id=72656

    Most of these appear to have come in with the VFS patch.
    Assigning to Vince to clarify and resolve.

     
  • Vince Darley

    Vince Darley - 2001-08-23
    • assigned_to: vincentdarley --> nobody
     
  • Vince Darley

    Vince Darley - 2001-08-23

    Logged In: YES
    user_id=32170

    Fixed all fs related items in cvs head. Two warnings
    probably remain; not sure who to assign those to.

     
  • Donal K. Fellows

    • assigned_to: nobody --> hobbs
     
  • Bob Techentin

    Bob Techentin - 2001-08-28

    Logged In: YES
    user_id=43494

    The warning in tclCompCmds.c, can be repaired with the patch (diff) I've supplied.
    The way I read TIPS #16 and #24, this is part of Events -> Time Measurement,
    which are maintained by Kevin Kenny, Daniel Steffen, Jim Ingham, and
    Jeff Hobbs

    star> diff -c ../generic/tclCompCmds.c.orig ../generic/tclCompCmds.c
    *** ../generic/tclCompCmds.c.orig Fri Aug 24 19:08:46 2001
    --- ../generic/tclCompCmds.c Tue Aug 28 07:54:39 2001
    ***************
    *** 2581,2587 ****
    *----------------------------------------------------------------------
    */

    ! int
    TclPushVarName(interp, varTokenPtr, envPtr, flags, localIndexPtr,
    maxDepthPtr, simpleVarNamePtr, isScalarPtr)
    Tcl_Interp *interp; /* Used for error reporting. */
    --- 2581,2587 ----
    *----------------------------------------------------------------------
    */

    ! static int
    TclPushVarName(interp, varTokenPtr, envPtr, flags, localIndexPtr,
    maxDepthPtr, simpleVarNamePtr, isScalarPtr)
    Tcl_Interp *interp; /* Used for error reporting. */

    The warning in tclDate.c is slightly more complex. It arises because the
    lex generated code includes a default function prototype on about line
    160 of tclDate.c.

    #ifndef TclDatelex
    int TclDatelex(void);
    #endif

    But since this is lex-generated code, I don't think you can just edit tclDate.c.
    And I don't know how to change tclGetDate.y to generate a static function
    prototype for this section. It might be that the yylex() function cannot be
    declared static in tclGetDate.y

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2001-08-28

    Logged In: YES
    user_id=72656

    fixed the last cast in tclCompCmds.c. The tclDate.c file,
    as noted, is auto-generated. It does different things
    depending on the yacc that generated it, and in all cases
    I've seen the code is just fine - just ignore the
    warnings. There is a gendate target that could be expanded.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2001-08-28
    • status: open --> closed-fixed