From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5780 invoked by alias); 5 Feb 2014 02:13:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 5766 invoked by uid 89); 5 Feb 2014 02:13:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 05 Feb 2014 02:13:18 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 6792C1165BA; Tue, 4 Feb 2014 21:13:16 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xlyquV4oBw4C; Tue, 4 Feb 2014 21:13:16 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id D5D811164CD; Tue, 4 Feb 2014 21:13:15 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id AE4A2E0945; Wed, 5 Feb 2014 06:13:12 +0400 (RET) Date: Wed, 05 Feb 2014 02:13:00 -0000 From: Joel Brobecker To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix building with yacc Message-ID: <20140205021312.GB5485@adacore.com> References: <201402031351.s13DpgDY020084@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201402031351.s13DpgDY020084@glazunov.sibelius.xs4all.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-02/txt/msg00032.txt.bz2 Hi Mark, > OpenBSD yacc doesn't use YYPRINT, so we end up with gcc complaining > that c_print_token is defined but not used. As far as I can determine > YYPRINT is a bison-ism, so the diff below wraps c_print_token in > #ifdef YYBISON. > > ok? I don't know bison much to really review the patch, but I think that you meant c_print_token to remain static, right? (see below) Aside from that, the change looks OK to me. ChangeLog? > diff --git a/gdb/c-exp.y b/gdb/c-exp.y > index 277242e..b76a06b 100644 > --- a/gdb/c-exp.y > +++ b/gdb/c-exp.y > @@ -169,8 +169,10 @@ static struct stoken operator_stoken (const char *); > static void check_parameter_typelist (VEC (type_ptr) *); > static void write_destructor_name (struct stoken); > > +#ifdef YYBISON > static void c_print_token (FILE *file, int type, YYSTYPE value); > #define YYPRINT(FILE, TYPE, VALUE) c_print_token (FILE, TYPE, VALUE) > +#endif > %} > > %type exp exp1 type_exp start variable qualified_name lcurly > @@ -3201,10 +3203,12 @@ c_parse (void) > return result; > } > > +#ifdef YYBISON > + > /* This is called via the YYPRINT macro when parser debugging is > enabled. It prints a token's value. */ > > -static void > +void > c_print_token (FILE *file, int type, YYSTYPE value) I think this "static void" -> "void" will break our build. > { > switch (type) > @@ -3255,6 +3259,8 @@ c_print_token (FILE *file, int type, YYSTYPE value) > } > } > > +#endif > + > void > yyerror (char *msg) > { -- Joel