Hi,

I think rpcgen -M might be missing the generation of the 'foo_freeresult_N'
server procedure signature in the generated foo_svc.c program.

I'm not sure however, as I did not manage to find proper documentation
about this. The fact is that I have a rpcgen program that fails to compile
properly with -Werror, while it's fine with other rpcgen implementations.
And the generated _svc.c program contains a call to this function, in
the Mflag != 0 case.

Anyway, attached is a tentative patch fixing things for me.

Best,
Anthony

Index: rpc_svcout.c
===================================================================
RCS file: /cvsroot/src/usr.bin/rpcgen/rpc_svcout.c,v
retrieving revision 1.31
diff -u -r1.31 rpc_svcout.c
--- rpc_svcout.c        8 Nov 2015 01:59:31 -0000       1.31
+++ rpc_svcout.c        5 Jun 2024 19:09:08 -0000
@@ -353,7 +353,18 @@
                pvname(def->def_name, vp->vers_num);
                f_print(fout, "(struct svc_req *%s, ", RQSTP);
                f_print(fout, "SVCXPRT *%s);\n", TRANSP);
+
+               if (Mflag) {
+                       if (storage != NULL) {
+                               f_print(fout, "%s ", storage);
+                       }
+                       f_print(fout, "int ");
+                       pvname(def->def_name, vp->vers_num);
+                       f_print(fout, "_freeresult"
+                                "(SVCXPRT *, xdrproc_t, caddr_t);\n");
+               }
                f_print(fout, "\n");
+
                if (storage != NULL) {
                        f_print(fout, "%s ", storage);
                }

Reply via email to