From: Joel Brobecker <brobecker@adacore.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix building with yacc
Date: Wed, 05 Feb 2014 02:13:00 -0000 [thread overview]
Message-ID: <20140205021312.GB5485@adacore.com> (raw)
In-Reply-To: <201402031351.s13DpgDY020084@glazunov.sibelius.xs4all.nl>
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 <voidval> 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
next prev parent reply other threads:[~2014-02-05 2:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-03 13:51 Mark Kettenis
2014-02-05 2:13 ` Joel Brobecker [this message]
2014-02-05 12:37 ` Mark Kettenis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140205021312.GB5485@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox