From a23330dbe249f7ebd81bb5be47c892e8fa9cc4f8 Mon Sep 17 00:00:00 2001 From: BtbN Date: Sun, 24 Nov 2024 20:22:18 +0100 Subject: [PATCH] Fix compilation with modern compilers Fixes error: jump to label 'try_tcpip' crosses initialization of 'const SOCKET listener' --- src/ip.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ip.cpp b/src/ip.cpp index 30d70eb0..721acb1d 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -557,6 +557,7 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_) socklen_t lcladdr_len = sizeof lcladdr; int rc = 0; int saved_errno = 0; + SOCKET listener = INVALID_SOCKET; // It appears that a lack of runtime AF_UNIX support // can fail in more than one way. @@ -569,7 +570,7 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_) } // Create a listening socket. - const SOCKET listener = open_socket (AF_UNIX, SOCK_STREAM, 0); + listener = open_socket (AF_UNIX, SOCK_STREAM, 0); if (listener == retired_fd) { // This may happen if the library was built on a system supporting AF_UNIX, but the system running doesn't support it. goto try_tcpip;