libzmq icon indicating copy to clipboard operation
libzmq copied to clipboard

Build issue on macOS 14.0

Open xanadu6291 opened this issue 1 year ago • 3 comments

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 avatar Oct 26 '23 08:10 xanadu6291

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?

xanadu6291 avatar Nov 27 '23 12:11 xanadu6291

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 avatar Jan 06 '24 22:01 devnullpointer

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

devnullpointer avatar Jan 06 '24 22:01 devnullpointer