From f1a3501750afeba2b750dc2cf64b017f795e2e4e Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 3 Mar 2015 16:02:42 +0100 Subject: [PATCH] The compiler cannot figure out if this is assigned properly The logic is a bit complex so we're going to have to silence the warning with this explicit assignment. --- common/network/TcpSocket.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/network/TcpSocket.cxx b/common/network/TcpSocket.cxx index 2545034c..5158e805 100644 --- a/common/network/TcpSocket.cxx +++ b/common/network/TcpSocket.cxx @@ -155,6 +155,10 @@ TcpSocket::TcpSocket(const char *host, int port) gai_strerror(result)); } + // This logic is too complex for the compiler to determine if + // sock is properly assigned or not. + sock = -1; + for (current = ai; current != NULL; current = current->ai_next) { family = current->ai_family; -- 2.39.5