From: Pierre Ossman Date: Tue, 3 Mar 2015 15:02:42 +0000 (+0100) Subject: The compiler cannot figure out if this is assigned properly X-Git-Tag: v1.4.90~33^2~31 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f1a3501750afeba2b750dc2cf64b017f795e2e4e;p=tigervnc.git 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. --- 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;