]> source.dussan.org Git - tigervnc.git/commitdiff
The compiler cannot figure out if this is assigned properly
authorPierre Ossman <ossman@cendio.se>
Tue, 3 Mar 2015 15:02:42 +0000 (16:02 +0100)
committerPierre Ossman <ossman@cendio.se>
Tue, 3 Mar 2015 15:02:42 +0000 (16:02 +0100)
The logic is a bit complex so we're going to have to silence the
warning with this explicit assignment.

common/network/TcpSocket.cxx

index 2545034c8e73c9844ccfed65220a23a44a8ab283..5158e805dd333694c07079542eac83dddcfa9108 100644 (file)
@@ -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;