[libvirt PATCH v2 0/1] rpc: Make rpcgen produce ANSI C code

Test pipeline: https://gitlab.com/abologna/libvirt/-/pipelines/1060019687 Changes from [v1] * retain portable-rpcgen support. [v1] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/2A3KK... Andrea Bolognani (1): rpc: Make rpcgen produce ANSI C code src/rpc/genprotocol.pl | 2 ++ 1 file changed, 2 insertions(+) -- 2.41.0

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

On Fri, Nov 03, 2023 at 11:49:52AM +0100, Andrea Bolognani wrote:
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> --- src/rpc/genprotocol.pl | 2 ++ 1 file changed, 2 insertions(+)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (2)
-
Andrea Bolognani
-
Daniel P. Berrangé