zeromq / libzmq

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

Error on step make from zeromq 4.2.2 on Ubuntu 22.04 #4578

Open allanbarbosa opened 1 year ago

allanbarbosa commented 1 year ago

Please use this template for reporting suspected bugs or requests for help.

Issue description

Hi, sorry for my bad english. I'm trying to configure the zeromq 4.2.2 on ubuntu 22.04 server and the step off make is showing the below error:

Making all in doc
make[1]: Entering directory '/tmp/zeromq-4.2.2/doc'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/tmp/zeromq-4.2.2/doc'
make[1]: Entering directory '/tmp/zeromq-4.2.2'
  CXX      src/src_libzmq_la-msg.lo
In file included from /usr/include/string.h:535,
                 from src/msg.cpp:34:
In function 'char* strncpy(char*, const char*, size_t)',
    inlined from 'int zmq::msg_t::set_group(const char*, size_t)' at src/msg.cpp:560:13,
    inlined from 'int zmq::msg_t::set_group(const char*)' at src/msg.cpp:549:22:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:34: error: 'char* __builtin___strncpy_chk(char*, const char*, long unsigned int, long unsigned int)' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
src/msg.cpp: In member function 'int zmq::msg_t::set_group(const char*)':
src/msg.cpp:549:22: note: length computed here
  549 |     return set_group (group_, strlen (group_));
      |            ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:3486: src/src_libzmq_la-msg.lo] Error 1
make[1]: Leaving directory '/tmp/zeromq-4.2.2'
make: *** [Makefile:4044: all-recursive] Error 1

Environment

Minimal test code / Steps to reproduce the issue

  1. wget https://github.com/zeromq/libzmq/releases/download/v4.2.2/zeromq-4.2.2.tar.gz
  2. tar -zxf zeromq-4.2.2.tar.gz
  3. cd zeromq-4.2.2
  4. ./configure
  5. make

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

In file included from /usr/include/string.h:535,
                 from src/msg.cpp:34:
In function 'char* strncpy(char*, const char*, size_t)',
    inlined from 'int zmq::msg_t::set_group(const char*, size_t)' at src/msg.cpp:560:13,
    inlined from 'int zmq::msg_t::set_group(const char*)' at src/msg.cpp:549:22:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:34: error: 'char* __builtin___strncpy_chk(char*, const char*, long unsigned int, long unsigned int)' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
src/msg.cpp: In member function 'int zmq::msg_t::set_group(const char*)':
src/msg.cpp:549:22: note: length computed here
  549 |     return set_group (group_, strlen (group_));
      |            ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:3486: src/src_libzmq_la-msg.lo] Error 1
make[1]: Leaving directory '/tmp/zeromq-4.2.2'
make: *** [Makefile:4044: all-recursive] Error 1

What's the expected result?

make install sucessfull.