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 <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Andrea Bolognani 2023-11-03 00:04:29 +01:00
parent 47ee78048c
commit abb6906260
1 changed files with 2 additions and 0 deletions

View File

@ -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: $!";