提交 3f573fba 编写于 作者: M Michal Privoznik

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#PLATFORMSSigned-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 b41bed70
......@@ -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 <config.h>\n";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册