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: 733811 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vXqhP4m8Hz9ryQ for ; Wed, 1 Mar 2017 07:20:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="TdmAghMe"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=JJ+8vw+3f66QRaeZ4Vn7uE8q8lQ5j18yOpQipZo7M8/ofK6qPOiFr pmv5bi1m9oD8lY/9xWoaujHbSLCDVMqpGuwif5z3JlEXBvVm/HTUAaDLF0/2eYLb w/EeTZNiuV1Gn1Co1Ku9wzSubZYaf8EYv7UL+SCuGg0cb9m1ymXe7k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=0c6F6hBrqhuK0OHebUlnDAHIiTE=; b=TdmAghMefjNwLKM0uRfPKqnKyDcp xCHMMQ67WEXkHoTEktvNfXATy7LRdhRSvdSnIjikb9+w4A/XpyvCKiwBRty3AsdE vwSLf94omVpke/21ZjjZLUjn0AJ8Lr9zV8rM4MzzpKBK1dOP8jem4ar2bwl5RXA4 kLHerUlg9k7NOrw= 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)) {