This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] rpcgen: skip over #define lines in CPP output [BZ #21205]


Sometimes the preprocessor will include #define lines in its output (like
when using gcc w/-ggdb3).  This causes rpcgen to choke with an error:
$ CPP='gcc -ggdb3 -E -x c-header' rpcgen -Y ../scripts/ -h rpcsvc/rex.x -o foo

rpcsvc/rex.x, line 1: preprocessor error

Change the parser to skip #define lines instead.
---
 sunrpc/rpc_scan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sunrpc/rpc_scan.c b/sunrpc/rpc_scan.c
index 0a88bafe768b..a230aa396b37 100644
--- a/sunrpc/rpc_scan.c
+++ b/sunrpc/rpc_scan.c
@@ -507,6 +507,8 @@ docppline (const char *line, int *lineno, const char **fname)
     {
       line++;
     }
+  if (strncmp (line, "define", 6) == 0)
+    return;
   num = atoi (line);
   while (isdigit (*line))
     {
-- 
2.11.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]