From: Andrea Bolognani Date: Thu, 2 Nov 2023 23:04:29 +0000 (+0100) Subject: rpc: Make rpcgen produce ANSI C code X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=abb6906260acc7f284e0aa035bef2f51f1509541;p=libvirt.git rpc: Make rpcgen produce ANSI C code This is the default for the version of rpcgen shipped with Linux distributions, but the one in macOS and possibly others default to K&R C, which modern compilers don't appreciate. Luckily, all versions of rpcgen shipped with our target platforms seem to support the -C option. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump Reviewed-by: Daniel P. Berrangé --- diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl index adf3991d7a..37216303dc 100755 --- a/src/rpc/genprotocol.pl +++ b/src/rpc/genprotocol.pl @@ -41,6 +41,8 @@ unlink $target; if ($rpcgen =~ /portable-rpcgen/) { $rpcgen = "$rpcgen -o -"; +} else { + $rpcgen = "$rpcgen -C"; } open RPCGEN, "-|", "$rpcgen $mode $xdrdef" or die "cannot run $rpcgen $mode $xdrdef: $!";