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

Build issue on macOS 14.0 #4610

Open
xanadu6291 opened this issue Oct 26, 2023 · 3 comments
Open

Build issue on macOS 14.0 #4610

xanadu6291 opened this issue Oct 26, 2023 · 3 comments

Comments

@xanadu6291
Copy link

Issue description

I can't build libzmq on macOS 14.0

Environment

  • libzmq version (commit hash if unreleased): Ver.4.3.5
  • OS: macOS 14.0

Minimal test code / Steps to reproduce the issue

  1. I configure the latest stable release (Ver.4.3.5) of libzmq as follows:
    $ ./configure --prefix=${TARGET} --enable-static --disable-shared --without-documentation

  2. Then type make

What's the actual result? (include assertion message & call stack if applicable)

I get the following error:
src/proxy.cpp:502:26: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
stats_proxy stats = {0};
^
{}
src/proxy.cpp:502:26: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
stats_proxy stats = {0};
^
{}
2 errors generated.
make[1]: *** [src/libzmq_la-proxy.lo] Error 1
make: *** [all-recursive] Error 1

What's the expected result?

Build correctly.

@xanadu6291
Copy link
Author

xanadu6291 commented Nov 27, 2023

I thought that the compiler claims to add braces. Which means:

stats_proxy stats = {0};
to
stats_proxy stats = {{0}};

But failed with same error. Then I tried to add one more braces. ( Yes, I don't understand C++ at all):

stats_proxy stats = {{0}};
to
stats_proxy stats = {{{0}}};

Then compiled zeromq successfully.

Is it OK to add two braces into stats_proxy stats?

@devnullpointer
Copy link

devnullpointer commented Jan 6, 2024

Same issue here building 4.3.5 on Ubuntu 22.04LTS.

CXX src/libzmq_la-poller_base.lo
CXX src/libzmq_la-polling_util.lo
CXX src/libzmq_la-pollset.lo
CXX src/libzmq_la-precompiled.lo
CXX src/libzmq_la-proxy.lo
src/proxy.cpp:502:26: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
stats_proxy stats = {0};
^
{}
src/proxy.cpp:502:26: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
stats_proxy stats = {0};
^
{}
2 errors generated.
make[1]: *** [Makefile:5869: src/libzmq_la-proxy.lo] Error 1

@devnullpointer
Copy link

Tried 4.3.4 on Ubuntu 22.04 LTS and it builds fine. Seems like an issue with 4.3.5

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