rpcgen: skip over #define lines in CPP output [BZ #21205]
Commit Message
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(+)
Comments
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
@@ -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))
{