[Top][All Lists]

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

Bug in rpcgen

From: Paco Moya
Subject: Bug in rpcgen
Date: Mon, 20 Oct 2003 21:10:52 +0200


Files *_xdr.c generated by rpcgen may be syntactically incorrect.

How to reproduce:

cat > p.x <<EOF
struct s {
  bool a[2];
rpcgen -N -h p.x > p.h
rpcgen -N -c p.x > p_xdr.c
make p_xdr.o

Output from rpcgen:

p_xdr.c: In function `xdr_s':
p_xdr.c:23: syntax error before `*'
p_xdr.c:25: `genp' undeclared (first use in this function)
p_xdr.c:25: (Each undeclared identifier is reported only once
p_xdr.c:25: for each function it appears in.)
p_xdr.c:40: syntax error before `*'

Suggested patch:

It follows the same style used in other parts of rpcgen in order
to consider the singularity of bool_t.

--- sunrpc/rpc_cout.c.orig      2001-09-05 02:07:01.000000000 +0200
+++ sunrpc/rpc_cout.c   2003-10-20 20:56:42.000000000 +0200
@@ -726,7 +726,10 @@
       tabify (fout, indent);
       f_print (fout, "{\n");
       tabify (fout, indent + 1);
-      f_print (fout, "register %s *genp;\n\n", decl->type);
+      if (streq (type, "bool"))
+       f_print (fout, "register bool_t *genp;\n\n");
+      else
+       f_print (fout, "register %s *genp;\n\n", decl->type);
       tabify (fout, indent + 1);
       f_print (fout,
               "for (i = 0, genp = objp->%s;\n", decl->name);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]