From: Florian Forster Date: Thu, 8 Sep 2011 17:49:09 +0000 (-0400) Subject: netcmd plugin: Add work-around for GCC warning. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4a1ebc0aae8d2a8475518d197b7b7451e4d4f414;p=collectd.git netcmd plugin: Add work-around for GCC warning. Change-Id: Iec6ffaf77e4ef3be90a677d3c51804affcf532cc --- diff --git a/src/netcmd.c b/src/netcmd.c index c2a0ddb3..a4c443c5 100644 --- a/src/netcmd.c +++ b/src/netcmd.c @@ -421,14 +421,18 @@ static int nc_connection_init (nc_connection_t *conn) /* {{{ */ if (conn->have_tls_session) { int status; + intptr_t fd; conn->read_buffer = malloc (NC_READ_BUFFER_SIZE); if (conn->read_buffer == NULL) return (ENOMEM); memset (conn->read_buffer, 0, NC_READ_BUFFER_SIZE); + /* Make (relatively) sure that 'fd' and 'void*' have the same size to make + * GCC happy. */ + fd = (intptr_t) conn->fd; gnutls_transport_set_ptr (conn->tls_session, - (gnutls_transport_ptr_t) conn->fd); + (gnutls_transport_ptr_t) fd); while (42) {