This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] rpcgen: skip over #define lines in CPP output [BZ #21205]
- From: Mike Frysinger <vapier at gentoo dot org>
- To: libc-alpha at sourceware dot org
- Date: Tue, 28 Feb 2017 13:20:12 -0700
- Subject: [PATCH] rpcgen: skip over #define lines in CPP output [BZ #21205]
- Authentication-results: sourceware.org; auth=none
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