Bug #22869
compiling Client.cc generate warnings
0%
Description
[ 2%] Building CXX object src/client/CMakeFiles/client.dir/Client.cc.o
In file included from /home/jcollin/workspace/ceph/src/messages/MClientReconnect.h:19,
from /home/jcollin/workspace/ceph/src/client/Client.cc:50:
/home/jcollin/workspace/ceph/src/mds/mdstypes.h: In constructor ‘inode_t::inode_t()’:
/home/jcollin/workspace/ceph/src/mds/mdstypes.h:539:36: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct quota_info_t’; use assignment or value-initialization instead [-Wclass-memaccess]
memset("a, 0, sizeof(quota));
^
/home/jcollin/workspace/ceph/src/mds/mdstypes.h:316:8: note: ‘struct quota_info_t’ declared here
struct quota_info_t
^~~~~~~~~~
In file included from /home/jcollin/workspace/ceph/src/client/Client.cc:53:
/home/jcollin/workspace/ceph/src/messages/MClientReply.h: In member function ‘void InodeStat::decode(ceph::buffer::list::iterator&, uint64_t)’:
/home/jcollin/workspace/ceph/src/messages/MClientReply.h:190:38: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct quota_info_t’; use assignment or value-initialization instead [-Wclass-memaccess]
memset("a, 0, sizeof(quota));
^
In file included from /home/jcollin/workspace/ceph/src/messages/MClientReconnect.h:19,
from /home/jcollin/workspace/ceph/src/client/Client.cc:50:
/home/jcollin/workspace/ceph/src/mds/mdstypes.h:316:8: note: ‘struct quota_info_t’ declared here
struct quota_info_t
^~~~~~~~~~
In file included from /home/jcollin/workspace/ceph/src/osd/OSDMap.h:28,
from /home/jcollin/workspace/ceph/src/messages/MOSDMap.h:20,
from /home/jcollin/workspace/ceph/src/client/Client.cc:58:
/home/jcollin/workspace/ceph/src/osd/osd_types.h: In member function ‘void object_stat_sum_t::clear()’:
/home/jcollin/workspace/ceph/src/osd/osd_types.h:1811:34: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct object_stat_sum_t’; use assignment or value-initialization instead [-Wclass-memaccess]
memset(this, 0, sizeof(this));
^
/home/jcollin/workspace/ceph/src/osd/osd_types.h:1641:8: note: ‘struct object_stat_sum_t’ declared here
struct object_stat_sum_t {
^~~~~~~~~~~~~~~
In file included from /home/jcollin/workspace/ceph/src/messages/MOSDMap.h:20,
from /home/jcollin/workspace/ceph/src/client/Client.cc:58:
/home/jcollin/workspace/ceph/src/osd/OSDMap.h: In constructor ‘OSDMap::Incremental::Incremental(epoch_t)’:
/home/jcollin/workspace/ceph/src/osd/OSDMap.h:430:36: warning: ‘void memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct uuid_d’; use assignment or value-initialization instead [-Wclass-memaccess]
memset(&fsid, 0, sizeof(fsid));
^
In file included from /home/jcollin/workspace/ceph/src/include/types.h:21,
from /home/jcollin/workspace/ceph/src/msg/msg_types.h:21,
from /home/jcollin/workspace/ceph/src/common/entity_name.h:20,
from /home/jcollin/workspace/ceph/src/common/config.h:20,
from /home/jcollin/workspace/ceph/src/client/Client.cc:45:
/home/jcollin/workspace/ceph/src/include/uuid.h:16:8: note: ‘struct uuid_d’ declared here
struct uuid_d {
^~~~
In file included from /home/jcollin/workspace/ceph/src/messages/MOSDMap.h:20,
from /home/jcollin/workspace/ceph/src/client/Client.cc:58:
/home/jcollin/workspace/ceph/src/osd/OSDMap.h: In constructor ‘OSDMap::OSDMap()’:
/home/jcollin/workspace/ceph/src/osd/OSDMap.h:594:34: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct uuid_d’; use assignment or value-initialization instead [-Wclass-memaccess]
memset(&fsid, 0, sizeof(fsid));
^
In file included from /home/jcollin/workspace/ceph/src/include/types.h:21,
from /home/jcollin/workspace/ceph/src/msg/msg_types.h:21,
from /home/jcollin/workspace/ceph/src/common/entity_name.h:20,
from /home/jcollin/workspace/ceph/src/common/config.h:20,
from /home/jcollin/workspace/ceph/src/client/Client.cc:45:
/home/jcollin/workspace/ceph/src/include/uuid.h:16:8: note: ‘struct uuid_d’ declared here
struct uuid_d {
^~~~
In file included from /home/jcollin/workspace/ceph/src/client/Client.cc:59:
/home/jcollin/workspace/ceph/src/messages/MClientQuota.h: In constructor ‘MClientQuota::MClientQuota()’:
/home/jcollin/workspace/ceph/src/messages/MClientQuota.h:15:36: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct nest_info_t’; use assignment or value-initialization instead [-Wclass-memaccess]
memset(&rstat, 0, sizeof(rstat));
^
In file included from /home/jcollin/workspace/ceph/src/messages/MClientReconnect.h:19,
from /home/jcollin/workspace/ceph/src/client/Client.cc:50:
/home/jcollin/workspace/ceph/src/mds/mdstypes.h:222:8: note: ‘struct nest_info_t’ declared here
struct nest_info_t : public scatter_info_t {
^~~~~~~~~
In file included from /home/jcollin/workspace/ceph/src/client/Client.cc:59:
/home/jcollin/workspace/ceph/src/messages/MClientQuota.h:16:36: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct quota_info_t’; use assignment or value-initialization instead [-Wclass-memaccess]
memset("a, 0, sizeof(quota));
^
In file included from /home/jcollin/workspace/ceph/src/messages/MClientReconnect.h:19,
from /home/jcollin/workspace/ceph/src/client/Client.cc:50:
/home/jcollin/workspace/ceph/src/mds/mdstypes.h:316:8: note: ‘struct quota_info_t’ declared here
struct quota_info_t
^~~~~~~~~~
In file included from /home/jcollin/workspace/ceph/src/mon/MonClient.h:22,
from /home/jcollin/workspace/ceph/src/client/Client.cc:64:
/home/jcollin/workspace/ceph/src/mon/MonMap.h: In constructor ‘MonMap::MonMap()’:
/home/jcollin/workspace/ceph/src/mon/MonMap.h:121:34: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct uuid_d’; use assignment or value-initialization instead [-Wclass-memaccess]
memset(&fsid, 0, sizeof(fsid));
^
In file included from /home/jcollin/workspace/ceph/src/include/types.h:21,
from /home/jcollin/workspace/ceph/src/msg/msg_types.h:21,
from /home/jcollin/workspace/ceph/src/common/entity_name.h:20,
from /home/jcollin/workspace/ceph/src/common/config.h:20,
from /home/jcollin/workspace/ceph/src/client/Client.cc:45:
/home/jcollin/workspace/ceph/src/include/uuid.h:16:8: note: ‘struct uuid_d’ declared here
struct uuid_d {
^~~~
In file included from /home/jcollin/workspace/ceph/src/client/Client.cc:84:
/home/jcollin/workspace/ceph/src/client/Inode.h: In constructor ‘Inode::Inode(Client*, vinodeno_t, file_layout_t*)’:
/home/jcollin/workspace/ceph/src/client/Inode.h:278:36: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct quota_info_t’; use assignment or value-initialization instead [-Wclass-memaccess]
memset("a, 0, sizeof(quota));
^
In file included from /home/jcollin/workspace/ceph/src/messages/MClientReconnect.h:19,
from /home/jcollin/workspace/ceph/src/client/Client.cc:50:
/home/jcollin/workspace/ceph/src/mds/mdstypes.h:316:8: note: ‘struct quota_info_t’ declared here
struct quota_info_t
^~~~~~~~~~
/home/jcollin/workspace/ceph/src/client/Client.cc: In member function ‘int Client::ll_delegation(Fh*, unsigned int, ceph_deleg_cb_t, void*)’:
/home/jcollin/workspace/ceph/src/client/Client.cc:13177:19: warning: catching polymorphic type ‘class std::bad_alloc’ by value [-Wcatch-value=]
} catch (std::bad_alloc) {
^~~~~~~
History
#1 Updated by Patrick Donnelly about 6 years ago
Jos, what options are you using to generate these warnings?
#2 Updated by Patrick Donnelly about 6 years ago
- Status changed from New to Need More Info
#3 Updated by Jos Collin about 6 years ago
Patrick,
I'm using: gcc (GCC) 8.0.1 20180131 (Red Hat 8.0.1-0.9).
At first look, I thought that this was a problem with Client.cc, as I was modifying Client.cc and then doing a build. But later on, I figured out that the entire build breaks with 8.0.1 showing different errors.
I think this can be closed, as the actual cause is different.
Thanks,
Jos Collin
#4 Updated by Patrick Donnelly about 6 years ago
Jos Collin wrote:
Patrick,
I'm using: gcc (GCC) 8.0.1 20180131 (Red Hat 8.0.1-0.9).
At first look, I thought that this was a problem with Client.cc, as I was modifying Client.cc and then doing a build. But later on, I figured out that the entire build breaks with 8.0.1 showing different errors.
So the newer GCC gives the warnings without any modifications to Client.cc? That would be useful.
I think this can be closed, as the actual cause is different.
If the warnings are against an unmodified tree, then we should investigate.
#5 Updated by Jos Collin about 6 years ago
Yes, the gcc 8.0.1 gives plenty of errors and warnings everywhere in the unmodified code. Yesterday, I have managed to bring back my dev environment. Yes, of-course these should be fixed for 8.0.1. But this problem is not something that is specific to client.cc. May be, gather all those errors and and some of the warnings and create a new ticket ?
#6 Updated by Jos Collin about 6 years ago
- Status changed from Need More Info to Closed
Closing this, as this is due to gcc 8.0.1 and it is not something specific to Client.cc. This warning comes everywhere in the Ceph source code using gcc 8.0.1.