incubator-pegasus icon indicating copy to clipboard operation
incubator-pegasus copied to clipboard

compilation failures of pegasus using gcc9

Open neverchanje opened this issue 5 years ago • 0 comments

Compilation failure of rdsn in origin/master.

compiler

gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

error outputs

ERROR#1

/home/wutao1/git/pegasus/rdsn/include/dsn/utility/time_utils.h: In function ‘void dsn::tools::print_header(FILE*, dsn_log_level_t)’:
/home/wutao1/git/pegasus/rdsn/include/dsn/utility/time_utils.h:47:24: error: ‘%02d’ directive writing between 2 and 11 bytes into a region of size between 0 and 16 [-Werror=format-overflow=]
   47 |             "%04d-%02d-%02d %02d:%02d:%02d.%03u",
      |                        ^~~~
/home/wutao1/git/pegasus/rdsn/include/dsn/utility/time_utils.h:47:13: note: directive argument in the range [0, 999]
   47 |             "%04d-%02d-%02d %02d:%02d:%02d.%03u",
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /usr/include/c++/9/ext/string_conversions.h:43,
                 from /usr/include/c++/9/bits/basic_string.h:6493,
                 from /usr/include/c++/9/string:55,
                 from /home/wutao1/git/pegasus/rdsn/include/dsn/utility/ports.h:63,
                 from /home/wutao1/git/pegasus/rdsn/include/dsn/utility/synchronize.h:28,
                 from /home/wutao1/git/pegasus/rdsn/include/dsn/utility/singleton_store.h:39,
                 from /home/wutao1/git/pegasus/rdsn/include/dsn/utility/factory_store.h:38,
                 from /home/wutao1/git/pegasus/rdsn/include/dsn/tool_api.h:54,
                 from /home/wutao1/git/pegasus/rdsn/src/utils/simple_logger.h:29,
                 from /home/wutao1/git/pegasus/rdsn/src/utils/simple_logger.cpp:27:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 24 and 76 bytes into a destination of size 24
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ERROR#2

/home/wutao1/git/pegasus/rdsn/src/runtime/rpc/rpc_message.cpp: In static member function ‘static dsn::message_ex* dsn::message_ex::copy_message_no_reply(const dsn::message_ex&)’:
/home/wutao1/git/pegasus/rdsn/src/runtime/rpc/rpc_message.cpp:184:50: error: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘dsn::message_header’ {aka ‘struct dsn::message_header’} with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess]
  184 |     memset(msg->header, 0, sizeof(message_header));
      |                                                  ^
In file included from /home/wutao1/git/pegasus/rdsn/src/runtime/rpc/rpc_message.cpp:39:
/home/wutao1/git/pegasus/rdsn/include/dsn/tool-api/rpc_message.h:79:16: note: ‘dsn::message_header’ {aka ‘struct dsn::message_header’} declared here
   79 | typedef struct message_header
      |                ^~~~~~~~~~~~~~

ERROR#3

/home/wutao1/git/pegasus/rdsn/include/dsn/cpp/json_helper.h:599:9:   required from ‘static bool dsn::json::json_forwarder< <template-parameter-1-1> >::decode(const dsn::blob&, T&) [with T = dsn::dist::block_service::file_metadata]’
/home/wutao1/git/pegasus/rdsn/src/block_service/local/local_service.cpp:247:54:   required from here
/home/wutao1/git/pegasus/rdsn/thirdparty/output/include/rapidjson/document.h:1952:24: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘rapidjson::GenericValue<rapidjson::UTF8<> >::Member’ {aka ‘struct rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >’} with no trivial copy-assignment; use copy-assignment instead [-Werror=class-memaccess]
 1952 |             std::memcpy(m, members, count * sizeof(Member));
      |             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/wutao1/git/pegasus/rdsn/include/dsn/cpp/json_helper.h:40,
                 from /home/wutao1/git/pegasus/rdsn/src/block_service/local/local_service.cpp:10:
/home/wutao1/git/pegasus/rdsn/thirdparty/output/include/rapidjson/document.h:71:8: note: ‘rapidjson::GenericValue<rapidjson::UTF8<> >::Member’ {aka ‘struct rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >’} declared here
   71 | struct GenericMember {
      |        ^~~~~~~~~~~~~

ERROR#4

In file included from /home/wutao1/git/pegasus/src/base/test/utils_test.cpp:20:
/home/wutao1/git/pegasus/src/base/test/../pegasus_utils.h: In instantiation of ‘std::__cxx11::list<elem_type> pegasus::utils::top_n<elem_type, compare>::to() [with elem_type = int; compare = std::less<int>]’:
/home/wutao1/git/pegasus/src/base/test/utils_test.cpp:30:56:   required from here
/home/wutao1/git/pegasus/src/base/test/../pegasus_utils.h:65:32: error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move]
   65 |         return std::move(result);
      |                                ^

neverchanje avatar Nov 11 '20 03:11 neverchanje