[LTP] [PATCH 1/2] rpc/rpc-tirpc: Fix compile error on clang when using clnt_broadcast
Petr Vorel
pvorel@suse.cz
Tue Apr 25 16:02:27 CEST 2023
Hi Xu,
> When clang upgrade to 16.0.0-2.fc38, these case will report
> incompatible-function-pointer-types error as below:
> rpc_clnt_broadcast_complex.c:81:46: error: incompatible function pointer types passing
> 'bool_t (char *, struct sockaddr_in *)' (aka 'int (char *, struct sockaddr_in *)') to
> parameter of type 'resultproc_t' (aka 'int (*)(char *, ...)') [-Wincompatible-function-pointer-types]
> (xdrproc_t) xdr_int, (char *)&varRec, eachResult);
> the clnt_broadcase declare as below:
> extern enum clnt_stat clnt_broadcast(u_long, u_long, u_long,
> xdrproc_t, void *,
> xdrproc_t, void *,
> resultproc_t);
> so we should add resultproc_t cast like tirpc_simple_rpc_broadcast[1] does.
> [1]https://github.com/linux-test-project/ltp/blob/master/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_complex.c#L84
Thank you for fixing this!
nit: I'd just mention tirpc_rpc_broadcast_complex.c in rpc_broadcast() call
does. (there is only single file, link will sooner or later point to the
different place, ...)
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
More information about the ltp
mailing list