summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-09-05 15:14:29 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-09-05 15:14:29 (GMT)
commit96c82a32e19afd4581f3aa21da39c8c6aa90bd7c (patch)
tree31455945857d2de92c86342b6a07d812a83f4350 /unix
parent2d7fb3bc20951567f5cd26584fb146ea5c271cc2 (diff)
parent26c1cd495a1ba8397db198e13aafe1a29287e6d0 (diff)
downloadtcl-96c82a32e19afd4581f3aa21da39c8c6aa90bd7c.zip
tcl-96c82a32e19afd4581f3aa21da39c8c6aa90bd7c.tar.gz
tcl-96c82a32e19afd4581f3aa21da39c8c6aa90bd7c.tar.bz2
Mark more function paramaters as unused. Now Tcl compiles fully (on UNIX and Windows) without -Wunused-parameters warnings
Diffstat (limited to 'unix')
-rwxr-xr-xunix/configure2
-rw-r--r--unix/tcl.m42
-rw-r--r--unix/tclLoadDl.c2
-rw-r--r--unix/tclSelectNotfy.c3
-rw-r--r--unix/tclUnixChan.c6
-rw-r--r--unix/tclUnixFCmd.c18
-rw-r--r--unix/tclUnixFile.c5
-rw-r--r--unix/tclUnixPipe.c3
8 files changed, 33 insertions, 8 deletions
diff --git a/unix/configure b/unix/configure
index 35f99ab..545291c 100755
--- a/unix/configure
+++ b/unix/configure
@@ -4934,7 +4934,7 @@ fi
if test "$GCC" = yes; then :
CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith"
+ CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith -Wunused-parameter"
else
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index c05f2d9..fdcb3d3 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -986,7 +986,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG=-g
AS_IF([test "$GCC" = yes], [
CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith"
+ CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith -Wunused-parameter"
], [
CFLAGS_OPTIMIZE=-O
CFLAGS_WARNING=""
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c
index 0fef500..4f63ab3 100644
--- a/unix/tclLoadDl.c
+++ b/unix/tclLoadDl.c
@@ -287,6 +287,8 @@ TclGuessPackageName(
Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
* name to this if possible. */
{
+ (void)fileName;
+ (void)bufPtr;
return 0;
}
diff --git a/unix/tclSelectNotfy.c b/unix/tclSelectNotfy.c
index cd62f6a..d3b3fe1 100644
--- a/unix/tclSelectNotfy.c
+++ b/unix/tclSelectNotfy.c
@@ -925,7 +925,7 @@ Tcl_WaitForEvent(
#if TCL_THREADS
static TCL_NORETURN void
NotifierThreadProc(
- ClientData clientData) /* Not used. */
+ ClientData dummy) /* Not used. */
{
ThreadSpecificData *tsdPtr;
fd_set readableMask;
@@ -937,6 +937,7 @@ NotifierThreadProc(
struct timeval poll = {0, 0}, *timePtr;
char buf[2];
int numFdBits = 0;
+ (void)dummy;
if (pipe(fds) != 0) {
Tcl_Panic("NotifierThreadProc: %s", "could not create trigger pipe");
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index f3814fb..2dc5f46 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -353,10 +353,11 @@ FileOutputProc(
static int
FileCloseProc(
void *instanceData, /* File state. */
- Tcl_Interp *interp) /* For error reporting - unused. */
+ Tcl_Interp *dummy) /* For error reporting - unused. */
{
FileState *fsPtr = (FileState *)instanceData;
int errorCode = 0;
+ (void)dummy;
Tcl_DeleteFileHandler(fsPtr->fd);
@@ -1927,7 +1928,7 @@ Tcl_GetOpenFile(
const char *chanID, /* String that identifies file. */
int forWriting, /* 1 means the file is going to be used for
* writing, 0 means for reading. */
- int checkUsage, /* 1 means verify that the file was opened in
+ int dummy, /* 1 means verify that the file was opened in
* a mode that allows the access specified by
* "forWriting". Ignored, we always check that
* the channel is open for the requested
@@ -1939,6 +1940,7 @@ Tcl_GetOpenFile(
const Tcl_ChannelType *chanTypePtr;
void *data;
FILE *f;
+ (void)dummy;
chan = Tcl_GetChannel(interp, chanID, &chanMode);
if (chan == NULL) {
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index f15c3d9..6f60664 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -1230,7 +1230,7 @@ TraversalCopy(
static int
TraversalDelete(
Tcl_DString *srcPtr, /* Source pathname (native). */
- Tcl_DString *ignore, /* Destination pathname (not used). */
+ Tcl_DString *dummy, /* Destination pathname (not used). */
const Tcl_StatBuf *statBufPtr,
/* Stat info for file specified by srcPtr. */
int type, /* Reason for call - see TraverseUnixTree(). */
@@ -1238,6 +1238,9 @@ TraversalDelete(
* filled with UTF-8 name of file causing
* error. */
{
+ (void)dummy;
+ (void)statBufPtr;
+
switch (type) {
case DOTREE_F:
if (TclpDeleteFile(Tcl_DStringValue(srcPtr)) == 0) {
@@ -1286,6 +1289,7 @@ CopyFileAtts(
{
struct utimbuf tval;
mode_t newMode;
+ (void)src;
newMode = statBufPtr->st_mode
& (S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO);
@@ -1344,6 +1348,7 @@ GetGroupAttribute(
Tcl_StatBuf statBuf;
struct group *groupPtr;
int result;
+ (void)objIndex;
result = TclpObjStat(fileName, &statBuf);
@@ -1398,6 +1403,7 @@ GetOwnerAttribute(
Tcl_StatBuf statBuf;
struct passwd *pwPtr;
int result;
+ (void)objIndex;
result = TclpObjStat(fileName, &statBuf);
@@ -1449,6 +1455,7 @@ GetPermissionsAttribute(
{
Tcl_StatBuf statBuf;
int result;
+ (void)objIndex;
result = TclpObjStat(fileName, &statBuf);
@@ -1492,6 +1499,7 @@ SetGroupAttribute(
Tcl_WideInt gid;
int result;
const char *native;
+ (void)objIndex;
if (Tcl_GetWideIntFromObj(NULL, attributePtr, &gid) != TCL_OK) {
Tcl_DString ds;
@@ -1558,6 +1566,7 @@ SetOwnerAttribute(
Tcl_WideInt uid;
int result;
const char *native;
+ (void)objIndex;
if (Tcl_GetWideIntFromObj(NULL, attributePtr, &uid) != TCL_OK) {
Tcl_DString ds;
@@ -1627,6 +1636,7 @@ SetPermissionsAttribute(
const char *native;
const char *modeStringPtr = TclGetString(attributePtr);
int scanned = TclParseAllWhiteSpace(modeStringPtr, -1);
+ (void)objIndex;
/*
* First supply support for octal number format
@@ -1739,7 +1749,7 @@ TclpObjListVolumes(void)
static int
GetModeFromPermString(
- Tcl_Interp *interp, /* The interp we are using for errors. */
+ Tcl_Interp *dummy, /* The interp we are using for errors. */
const char *modeStringPtr, /* Permissions string */
mode_t *modePtr) /* pointer to the mode value */
{
@@ -1748,6 +1758,7 @@ GetModeFromPermString(
* is passed in), to allow for the chmod style
* manipulation. */
int i,n, who, op, what, op_found, who_found;
+ (void)dummy;
/*
* We start off checking for an "rwxrwxrwx" style permissions string
@@ -1929,7 +1940,7 @@ GetModeFromPermString(
int
TclpObjNormalizePath(
- Tcl_Interp *interp,
+ Tcl_Interp *dummy,
Tcl_Obj *pathPtr,
int nextCheckpoint)
{
@@ -1942,6 +1953,7 @@ TclpObjNormalizePath(
#ifndef NO_REALPATH
char normPath[MAXPATHLEN];
#endif
+ (void)dummy;
/*
* We add '1' here because if nextCheckpoint is zero we know that '/'
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 2f6baf6..6b0ddb0 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -44,6 +44,8 @@ TclpFindExecutable(
int length;
char buf[PATH_MAX * 2];
char name[PATH_MAX * TCL_UTF_MAX + 1];
+ (void)argv0;
+
GetModuleFileNameW(NULL, buf, PATH_MAX);
cygwin_conv_path(3, buf, name, PATH_MAX);
length = strlen(name);
@@ -555,6 +557,8 @@ NativeMatchType(
return matchResult;
}
}
+#else
+ (void)interp;
#endif /* MAC_OSX_TCL */
return 1;
@@ -1018,6 +1022,7 @@ Tcl_Obj *
TclpFilesystemPathType(
Tcl_Obj *pathPtr)
{
+ (void)pathPtr;
/*
* All native paths are of the same type.
*/
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c
index bb01597..31d9671 100644
--- a/unix/tclUnixPipe.c
+++ b/unix/tclUnixPipe.c
@@ -271,6 +271,7 @@ TclpTempFileNameForLibrary(
Tcl_Obj *path) /* Path name of the library in the VFS. */
{
Tcl_Obj *retval = TclpTempFileName();
+ (void)path;
if (retval == NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -813,6 +814,7 @@ Tcl_CreatePipe(
int flags) /* Reserved for future use. */
{
int fileNums[2];
+ (void)flags;
if (pipe(fileNums) < 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf("pipe creation failed: %s",
@@ -1261,6 +1263,7 @@ Tcl_PidObjCmd(
PipeState *pipePtr;
int i;
Tcl_Obj *resultPtr;
+ (void)dummy;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?channelId?");