From abb6906260acc7f284e0aa035bef2f51f1509541 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Fri, 3 Nov 2023 00:04:29 +0100 Subject: [PATCH] rpc: Make rpcgen produce ANSI C code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é --- src/rpc/genprotocol.pl | 2 ++ 1 file changed, 2 insertions(+) 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: $!";