Subject: Fix compiler warning when compiling Itcl 4.0: In file included from ./generic/itcl2TclOO.c:12:0: /Tcl/include/tclInt.h:3012:8: warning: ‘struct addrinfo’ declared inside parameter list [enabled by default] const char **errorMsgPtr); ^

From: "jan.nijtmans" <[email-masked]>
Date: Wed, 3 Jul 2013 08:59:09 +0000

---
 generic/tclIOSock.c | 4 ++--
 generic/tclInt.h    | 5 ++---
 unix/tclUnixSock.c  | 5 +++--
 win/tclWinSock.c    | 5 +++--
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c
index 694501f..7d6c462 100644
--- a/generic/tclIOSock.c
+++ b/generic/tclIOSock.c
@@ -139,7 +139,7 @@ int
 TclCreateSocketAddress(
     Tcl_Interp *interp,                 /* Interpreter for querying
 					 * the desired socket family */
-    struct addrinfo **addrlist,		/* Socket address list */
+    void **addrlist,		/* Socket address list */
     const char *host,			/* Host. NULL implies INADDR_ANY */
     int port,				/* Port number */
     int willBind,			/* Is this an address to bind() to or
@@ -213,7 +213,7 @@ TclCreateSocketAddress(
 	hints.ai_flags |= AI_PASSIVE;
     } 
 
-    result = getaddrinfo(native, portstring, &hints, addrlist);
+    result = getaddrinfo(native, portstring, &hints, (struct addrinfo **) addrlist);
 
     if (host != NULL) {
 	Tcl_DStringFree(&ds);
diff --git a/generic/tclInt.h b/generic/tclInt.h
index fdd577a..b940225 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -3010,9 +3010,8 @@ MODULE_SCOPE void	TclpFinalizeMutex(Tcl_Mutex *mutexPtr);
 MODULE_SCOPE void	TclpFinalizePipes(void);
 MODULE_SCOPE void	TclpFinalizeSockets(void);
 MODULE_SCOPE int	TclCreateSocketAddress(Tcl_Interp *interp,
-			    struct addrinfo **addrlist,
-			    const char *host, int port, int willBind,
-			    const char **errorMsgPtr);
+			    void **addrlist, const char *host, int port,
+			    int willBind, const char **errorMsgPtr);
 MODULE_SCOPE int	TclpThreadCreate(Tcl_ThreadId *idPtr,
 			    Tcl_ThreadCreateProc *proc, ClientData clientData,
 			    int stackSize, int flags);
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 528f009..9c3d7eb 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -1131,7 +1131,7 @@ Tcl_OpenTcpClient(
 {
     TcpState *state;
     const char *errorMsg = NULL;
-    struct addrinfo *addrlist = NULL, *myaddrlist = NULL;
+    void *addrlist = NULL, *myaddrlist = NULL;
     char channelName[SOCK_CHAN_LENGTH];
 
     /*
@@ -1276,7 +1276,8 @@ Tcl_OpenTcpServer(
     ClientData acceptProcData)	/* Data for the callback. */
 {
     int status = 0, sock = -1, reuseaddr = 1, chosenport = 0;
-    struct addrinfo *addrlist = NULL, *addrPtr;	/* socket address */
+    void *addrlist = NULL;
+    struct addrinfo *addrPtr;	/* socket address */
     TcpState *statePtr = NULL;
     char channelName[SOCK_CHAN_LENGTH];
     const char *errorMsg = NULL;
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 4ced0e7..f4d5a90 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -1131,9 +1131,10 @@ CreateSocket(
     int asyncConnect = 0;	/* Will be 1 if async connect is in
 				 * progress. */
     unsigned short chosenport = 0;
-    struct addrinfo *addrlist = NULL, *addrPtr;
+    void *addrlist = NULL, *myaddrlist = NULL;
+    struct addrinfo *addrPtr;
 				/* Socket address to connect to. */
-    struct addrinfo *myaddrlist = NULL, *myaddrPtr;
+    struct addrinfo *myaddrPtr;
 				/* Socket address for our side. */
     const char *errorMsg = NULL;
     SOCKET sock = INVALID_SOCKET;
-- 
cgit v0.12