From 7593fce2300c45d321ff47f31909d0fafe03bf68 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 16 Oct 2022 16:57:29 +0000 Subject: Prevent warning: tclUnixSock.c:1079:19: warning: unused variable 'size' [-Wunused-variable] --- unix/tclUnixSock.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index abd7fa6..43303f8 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -1016,8 +1016,8 @@ TcpGetOptionProc( if ((len == 0) || ((len > 1) && (optionName[1] == 's') && (strncmp(optionName, "-sockname", len) == 0))) { TcpFdList *fds; - address sockname; - socklen_t size; + address sockname; + socklen_t size; int found = 0; WaitForConnect(statePtr, NULL); @@ -1056,7 +1056,9 @@ TcpGetOptionProc( if ((len == 0) || ((len > 1) && (optionName[1] == 'k') && (strncmp(optionName, "-keepalive", len) == 0))) { - socklen_t size; +#if defined(SO_KEEPALIVE) + socklen_t size; +#endif int opt = 0; if (len == 0) { @@ -1074,7 +1076,9 @@ TcpGetOptionProc( if ((len == 0) || ((len > 1) && (optionName[1] == 'n') && (strncmp(optionName, "-nodelay", len) == 0))) { - socklen_t size; +#if defined(SOL_TCP) && defined(TCP_NODELAY) + socklen_t size; +#endif int opt = 0; if (len == 0) { -- cgit v0.12