Message ID | 20170228202012.13576-1-vapier@gentoo.org |
---|---|
State | New |
Headers | show |
On 28 Feb 2017 13:20, Mike Frysinger wrote: > 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. ping ? -mike
On 02/28/2017 09:20 PM, Mike Frysinger wrote: > + if (strncmp (line, "define", 6) == 0) > + return; Please add a comment and perhaps a test case. Thanks, Florian
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)) {