From 3f573fbae13638e9c434e7176aabe80e88713f64 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 27 Sep 2013 16:20:49 +0200 Subject: [PATCH] genprotocol.pl: Fix code on FreeBSD too On some systems (linux, cygwin and gnukfreebsd) rpcgen generates files which when compiling produces this warning: remote/remote_protocol.c: In function 'xdr_remote_node_get_cpu_stats_ret': remote/remote_protocol.c:530: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] Hence, on those systems we need to post-process the files by the rpc/genprotocol.pl perl script. At the beginning of the script the OS is detected via $^O perl variable. From my latest build on FreeBSD I see we need to fix the code there too. On FreeBSD the variable contains 'freebsd' string: http://perldoc.perl.org/perlport.html#PLATFORMS Signed-off-by: Michal Privoznik --- src/rpc/genprotocol.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl index 4f8b6c4d0a..6e6d6d4a93 100755 --- a/src/rpc/genprotocol.pl +++ b/src/rpc/genprotocol.pl @@ -43,7 +43,7 @@ open RPCGEN, "-|", $rpcgen, $mode, $xdrdef open TARGET, ">$target" or die "cannot create $target: $!"; -my $fixup = $^O eq "linux" || $^O eq "cygwin" || $^O eq "gnukfreebsd"; +my $fixup = $^O eq "linux" || $^O eq "cygwin" || $^O eq "gnukfreebsd" || $^O eq "freebsd"; if ($mode eq "-c") { print TARGET "#include \n"; -- GitLab