From patchwork Tue Feb 28 20:20:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 19410 Received: (qmail 118513 invoked by alias); 28 Feb 2017 20:20:19 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 118428 invoked by uid 89); 28 Feb 2017 20:20:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.gentoo.org From: Mike Frysinger To: libc-alpha@sourceware.org Subject: [PATCH] rpcgen: skip over #define lines in CPP output [BZ #21205] Date: Tue, 28 Feb 2017 13:20:12 -0700 Message-Id: <20170228202012.13576-1-vapier@gentoo.org> 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)) {