[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#165289: libc6-dev: rpcgen generates bad code in K&R mode



At Thu, 30 Dec 2004 20:00:40 +0100,
Erik Schanze wrote:
> I have tried obove code on my system (sarge) and some warnings are fixed in 
> sarge, but one warning still remain:
> 
> es@morpheus:~/tmp$ gcc -Wall -c trivial_svc.c
> trivial_svc.c: In Funktion »main«:
> trivial_svc.c:63: Warnung: implicit declaration of function `pmap_unset'
> 
> After adding "#include <rpc/pmap_clnt.h>" the warning is fixed.
> 
> I think rpcgen should do this.

I guess this is original TI-RPC 2.3's bug.  However nowadays gcc and
glibc are depressing to use K&R style, so this bug is very trivial and
moreover you should not use this option.  But the fix patch is
attached.

Regards,
-- gotom

Index: sunrpc/rpc_main.c
===================================================================
RCS file: /cvs/glibc/libc/sunrpc/rpc_main.c,v
retrieving revision 1.24
diff -u -r1.24 rpc_main.c
--- sunrpc/rpc_main.c	17 Oct 2004 14:59:39 -0000	1.24
+++ sunrpc/rpc_main.c	13 Jan 2005 12:51:51 -0000
@@ -695,9 +695,9 @@
 
   fprintf (fout, "#include <stdio.h>\n");
   fprintf (fout, "#include <stdlib.h>\n");
+  fprintf (fout, "#include <rpc/pmap_clnt.h>\n");
   if (Cflag)
     {
-      fprintf (fout, "#include <rpc/pmap_clnt.h>\n");
       fprintf (fout, "#include <string.h>\n");
     }
   if (strcmp (svcclosetime, "-1") == 0)





Reply to: