Description of the problem: ‘xdr_sizeof’ is implicitly declared and warnings are treated as errors. Version-Release number of selected component: 3199f8759ebfcc31ce158201c3c25d9a738479f8 How reproducible: Building on Debian 9. Steps to Reproduce: 1. ./autogen.sh 2. ./configure 3. make all -jN Actual results: CC autoscale-threads.lo In file included from rpc-clnt.h:18:0, from mgmt-pmap.c:13: ../../../rpc/xdr/src/glusterfs3.h: In function ‘dict_to_xdr’: ../../../rpc/xdr/src/glusterfs3.h:800:12: error: implicit declaration of functio n ‘xdr_sizeof’ [-Werror=implicit-function-declaration] size = xdr_sizeof((xdrproc_t)xdr_gfx_dict, dict); ^~~~~~~~~~ In file included from rpc-clnt.h:18:0, from rpc-clnt.c:13: ../../../rpc/xdr/src/glusterfs3.h: In function ‘dict_to_xdr’: ../../../rpc/xdr/src/glusterfs3.h:800:12: error: implicit declaration of functio n ‘xdr_sizeof’ [-Werror=implicit-function-declaration] size = xdr_sizeof((xdrproc_t)xdr_gfx_dict, dict); ^~~~~~~~~~ rpc-clnt.c: In function ‘rpc_clnt_new’: rpc-clnt.c:1103:5: warning: dereferencing type-punned pointer will break strict- aliasing rules [-Wstrict-aliasing] GF_ATOMIC_INIT(rpc->xid, 1); ^~~~~~~~~~~~~~ rpc-clnt.c:1103:5: warning: dereferencing type-punned pointer will break strict- aliasing rules [-Wstrict-aliasing] rpc-transport.c: In function ‘rpc_transport_load’: rpc-transport.c:371:5: warning: dereferencing type-punned pointer will break str ict-aliasing rules [-Wstrict-aliasing] GF_ATOMIC_INIT(trans->disconnect_progress, 0); ^~~~~~~~~~~~~~ rpc-transport.c:371:5: warning: dereferencing type-punned pointer will break str ict-aliasing rules [-Wstrict-aliasing] rpcsvc.c: In function ‘rpcsvc_callback_build_record’: rpcsvc.c:1197:16: error: implicit declaration of function ‘xdr_sizeof’ [-Werror= implicit-function-declaration] xdr_size = xdr_sizeof((xdrproc_t)xdr_callmsg, &request); ^~~~~~~~~~ In file included from rpc-clnt.h:18:0, from rpc-clnt-ping.c:11: ../../../rpc/xdr/src/glusterfs3.h: In function ‘dict_to_xdr’: ../../../rpc/xdr/src/glusterfs3.h:800:12: error: implicit declaration of functio n ‘xdr_sizeof’ [-Werror=implicit-function-declaration] size = xdr_sizeof((xdrproc_t)xdr_gfx_dict, dict); ^~~~~~~~~~ cc1: some warnings being treated as errors Expected results: CC autoscale-threads.lo CC mgmt-pmap.lo Additional info: ~./configure --with-ipv6-default~ solves the problem, but there is another solution: diff --git a/rpc/rpc-lib/src/xdr-common.h b/rpc/rpc-lib/src/xdr-common.h index 7b0bc36ec..752736b3d 100644 --- a/rpc/rpc-lib/src/xdr-common.h +++ b/rpc/rpc-lib/src/xdr-common.h @@ -66,11 +66,9 @@ enum gf_dump_procnum { #ifdef GF_LINUX_HOST_OS #define xdr_u_int32_t xdr_uint32_t #define xdr_u_int64_t xdr_uint64_t -#ifdef IPV6_DEFAULT unsigned long xdr_sizeof(xdrproc_t func, void *data); #endif -#endif #ifdef GF_DARWIN_HOST_OS #define xdr_u_quad_t xdr_u_int64_t
REVIEW: https://review.gluster.org/23819 (rpc: define xdr_sizeof regardless of whether IPv6 is the default) posted (#1) for review on master by None
@Raghavendra, can you check if this is the right thing to do to fix the compilation issue. This seems a duplicate of bug #1539142, where the solution there is to use '--with-libtirpc=no'. Which one if the correct approach ?
REVIEW: https://review.gluster.org/23819 (rpc: define xdr_sizeof regardless of whether IPv6 is the default) merged (#2) on master by MOHIT AGRAWAL