rpcgen generates almost correct ANSI C code. The problem is that in generated sample client main function lacks proper declaration by omitting return type. Incorrect declaration also makes it impossible to compile generated code with c++ compiler. Another problem is that sample makefile uses $(RM) macro, but does not define it. Let's change it to just rm as in src/Makefile.inc1. Fix: Patch attached with submission follows: How-To-Repeat: $ cat test.x program TEST_PROG { version TEST_VERS { int TEST(int) = 1; } = 1; } = 0x23456789; $ rpcgen -aC test.x $ make -f makefile.test cc -O3 -fstrict-aliasing -pipe -march=native -fno-omit-frame-pointer -c test_clnt.c cc -O3 -fstrict-aliasing -pipe -march=native -fno-omit-frame-pointer -c test_client.c test_client.c:37:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] main(int argc, char *argv[]) ^~~~ 1 warning generated. cc -o test_client test_clnt.o test_client.o cc -O3 -fstrict-aliasing -pipe -march=native -fno-omit-frame-pointer -c test_svc.c cc -O3 -fstrict-aliasing -pipe -march=native -fno-omit-frame-pointer -c test_server.c cc -o test_server test_svc.o test_server.o $ make -f makefile.test clean -f core test.h test_clnt.c test_svc.c test_client.c test_server.c test_clnt.o test_client.o test_svc.o test_server.o test_client test_server make: exec(-f) failed (No such file or directory) *** Error code 1 Stop. make: stopped in /usr/home/kaktus/kodzik/rpc/test
I will get this in this week. Juggling a few other things. This is quite trivial though.
A commit references this bug: Author: bdrewery Date: Fri Jun 6 17:38:38 UTC 2014 New revision: 267174 URL: http://svnweb.freebsd.org/changeset/base/267174 Log: Fix some rpcgen sample file issues. * -Sc was generating code without a return type on main. * -Sm was generating an unusable clean target due to undefined RM. * -Sm was generating clean target with extra preceding space. PR: 185582 Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com> MFC after: 1 week Changes: head/usr.bin/rpcgen/rpc_main.c head/usr.bin/rpcgen/rpc_sample.c
A commit references this bug: Author: bdrewery Date: Fri Jun 13 15:04:22 UTC 2014 New revision: 267444 URL: http://svnweb.freebsd.org/changeset/base/267444 Log: MFC r267174: Fix some rpcgen sample file issues. PR: 185582 Changes: _U stable/10/ stable/10/usr.bin/rpcgen/rpc_main.c stable/10/usr.bin/rpcgen/rpc_sample.c
A commit references this bug: Author: bdrewery Date: Tue Jun 24 15:54:42 UTC 2014 New revision: 267822 URL: http://svnweb.freebsd.org/changeset/base/267822 Log: MFC r267174: Fix some rpcgen sample file issues. PR: 185582 Changes: _U stable/9/usr.bin/rpcgen/ stable/9/usr.bin/rpcgen/rpc_main.c stable/9/usr.bin/rpcgen/rpc_sample.c