summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2020-03-05 19:09:15 (GMT)
committerdgp <dgp@users.sourceforge.net>2020-03-05 19:09:15 (GMT)
commit39cde7c0690d27d2111100d0712876e759cf0f54 (patch)
tree7ee4784955af716dbd5fdf9c18e7bf972fc8e9ae /generic
parentf5a3d0b135e2d3b912803b94da63fac1edc29cdc (diff)
parent71e8c4c72b18b1f2e78b53f4ca5d67a029de99d0 (diff)
downloadtcl-39cde7c0690d27d2111100d0712876e759cf0f54.zip
tcl-39cde7c0690d27d2111100d0712876e759cf0f54.tar.gz
tcl-39cde7c0690d27d2111100d0712876e759cf0f54.tar.bz2
Merge TCL_UNUSED to dev branches for full Travis testing as a tool to arrest
the undesirable explosion of "(void)dummy" through the codebase.
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.h10
-rw-r--r--generic/tclZlib.c3
2 files changed, 11 insertions, 2 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 369a894..4e601ca 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -146,6 +146,11 @@ extern "C" {
# else
# define TCL_NORETURN1 /* nothing */
# endif
+# if defined(__cplusplus)
+# define TCL_UNUSED(T) T
+# else
+# define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused))
+# endif
#else
# define TCL_FORMAT_PRINTF(a,b)
# if defined(_MSC_VER) && (_MSC_VER >= 1310)
@@ -156,6 +161,11 @@ extern "C" {
# define TCL_NOINLINE /* nothing */
# endif
# define TCL_NORETURN1 /* nothing */
+# if defined(__cplusplus)
+# define TCL_UNUSED(T) T
+# else
+# define TCL_UNUSED(T) T JOIN(dummy, __LINE__)
+# endif
#endif
/*
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index ac69511..1ab20fe 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -1920,7 +1920,7 @@ Tcl_ZlibAdler32(
static int
ZlibCmd(
- void *dummy,
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1939,7 +1939,6 @@ ZlibCmd(
CMD_ADLER, CMD_COMPRESS, CMD_CRC, CMD_DECOMPRESS, CMD_DEFLATE,
CMD_GUNZIP, CMD_GZIP, CMD_INFLATE, CMD_PUSH, CMD_STREAM
};
- (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "command arg ?...?");