Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails with gcc 14+ #4753

Open
BtbN opened this issue Nov 3, 2024 · 1 comment
Open

Compilation fails with gcc 14+ #4753

BtbN opened this issue Nov 3, 2024 · 1 comment

Comments

@BtbN
Copy link
Contributor

BtbN commented Nov 3, 2024

15.95 /50-libzmq/src/ip.cpp: In function 'int zmq::make_fdpair(fd_t*, fd_t*)':
15.95 /50-libzmq/src/ip.cpp:678:1: error: jump to label 'try_tcpip'
15.95   678 | try_tcpip:
15.95       | ^~~~~~~~~
15.95 /50-libzmq/src/ip.cpp:568:14: note:   from here
15.95   568 |         goto try_tcpip;
15.95       |              ^~~~~~~~~
15.95 /50-libzmq/src/ip.cpp:572:18: note:   crosses initialization of 'const SOCKET listener'
15.95   572 |     const SOCKET listener = open_socket (AF_UNIX, SOCK_STREAM, 0);
15.95       |      

This is an issue since #4734 was merged.
The variable needs to be zero-initialized before the goto at the very least.

@jaapiyo
Copy link

jaapiyo commented Nov 15, 2024

I have the same issue, compiling for x64 on Windows.

[build] FAILED: _deps/libzmq-build/CMakeFiles/libzmq-static.dir/src/ip.cpp.obj 
[build] C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe  /nologo /TP -DFD_SETSIZE=16384 -DZMQ_CUSTOM_PLATFORM_HPP -DZMQ_STATIC -D_CRT_SECURE_NO_WARNINGS -D_REENTRANT -D_THREAD_SAFE -D_WIN32_WINNT=0x0A00 -D_WINSOCK_DEPRECATED_NO_WARNINGS -IC:\dev\ExtDataViewer\ExtDataViewer\out\build\x64-debug\_deps\libzmq-src\include -IC:\dev\ExtDataViewer\ExtDataViewer\out\build\x64-debug\_deps\libzmq-build -DZMQ_STATIC /EHsc /W3 /MP /MDd /Ob0 /Od /RTC1 -std:c++20 -ZI /DZMQ_STATIC /Yuprecompiled.hpp /showIncludes /Fo_deps\libzmq-build\CMakeFiles\libzmq-static.dir\src\ip.cpp.obj /Fd_deps\libzmq-build\CMakeFiles\libzmq-static.dir\libzmq-static.pdb /FS -c C:\dev\ExtDataViewer\ExtDataViewer\out\build\x64-debug\_deps\libzmq-src\src\ip.cpp
[build] C:\dev\ExtDataViewer\ExtDataViewer\out\build\x64-debug\_deps\libzmq-src\src\ip.cpp(572): error C2362: initialization of 'listener' is skipped by 'goto try_tcpip'
[build] C:\dev\ExtDataViewer\ExtDataViewer\out\build\x64-debug\_deps\libzmq-src\src\ip.cpp(678): note: see declaration of 'try_tcpip'

My solution was to stick to the latest stable release in my CMake configuration.

FetchContent_Declare(libzmq 
	GIT_REPOSITORY https://github.com/zeromq/libzmq
	GIT_TAG        622fc6dde99ee172ebaa9c8628d85a7a1995a21d # release-4.3.5
) 

FetchContent_MakeAvailable(libzmq)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants