From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2275 invoked by alias); 3 Feb 2014 13:51:48 -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 2257 invoked by uid 89); 3 Feb 2014 13:51:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: glazunov.sibelius.xs4all.nl Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 03 Feb 2014 13:51:47 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id s13DphiH019241 for ; Mon, 3 Feb 2014 14:51:43 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id s13DpgDY020084; Mon, 3 Feb 2014 14:51:43 +0100 (CET) Date: Mon, 03 Feb 2014 13:51:00 -0000 Message-Id: <201402031351.s13DpgDY020084@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: gdb-patches@sourceware.org Subject: [PATCH] Fix building with yacc X-SW-Source: 2014-02/txt/msg00015.txt.bz2 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? 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) { switch (type) @@ -3255,6 +3259,8 @@ c_print_token (FILE *file, int type, YYSTYPE value) } } +#endif + void yyerror (char *msg) {