GCC-10 and -Werror

8 views
Skip to first unread message

David Barto

unread,
Nov 28, 2020, 2:01:49 PM11/28/20
to grpc.io
When compiling grpc (gRPC-C++.podspec:  grpc_version = '1.17.0') I get an error because of the use of memset on a class.

src/cpp/common/channel_filter.cc: In member function ‘grpc_linked_mdelem* grpc::MetadataBatch::AddMetadata(const string&, const string&)’:
src/cpp/common/channel_filter.cc:33:48: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘grpc_linked_mdelem’ {aka ‘struct grpc_linked_mdelem’}; use assignment or value-initialization instead [-Wclass-memaccess]
   33 |   memset(storage, 0, sizeof(grpc_linked_mdelem));
      |                                                ^

If this is fixed in a later version of gRPC, please let me know which one fixed it, if not when would a fix be expected?

Thanks,
     David


Reply all
Reply to author
Forward
0 new messages