zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.46k stars 2.34k forks source link

Build issue on macOS 14.0 #4610

Open xanadu6291 opened 8 months ago

xanadu6291 commented 8 months ago

Issue description

I can't build libzmq on macOS 14.0

Environment

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 commented 7 months ago

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 commented 6 months ago

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 commented 6 months ago

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