Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix build failure on macOS
Date: Wed, 18 Dec 2019 16:32:00 -0000	[thread overview]
Message-ID: <19dacf6b-b2b4-8e60-20fc-5e0d3ba9dc35@simark.ca> (raw)
In-Reply-To: <20191218150518.8540-1-tromey@adacore.com>

On 2019-12-18 10:05 a.m., Tom Tromey wrote:
> PR build/25250 notes that the gdb 9 pre-release fails to build on
> macOS, due to a name clash between field_kind::STRING and the STRING
> token in ada-exp.y.  I am not sure (I couldn't reproduce this myself),
> but presumably this is due to differences caused by the version of
> bison in use there.
> 
> This patch works around the problem by renaming the field_kind
> enumerator.  I chose to rename this one because it is used in
> relatively few places -- it's just an implementation detail of the
> style code.
> 
> Let me know what you think.  I intend to check this in on the gdb 9
> branch as well.

The difference between macOS's bison (2.3) and later version (I'm not sure at
which release the behavior changed) is that the order of the prologue (where
we #include stuff) versus the bison declarations (#define STRING xyz) changed.
Bison 2.3 puts the declarations before the prologue, which can break included
files as we see here.  Later versions put the prologue before (actually the
exact location of the code can be controlled by using %code).

I don't really mind this particular fix, as it doesn't add complexity.  But if
in the future the macOS version gives us some more major headache, I would be
comfortable just saying that we don't support it, and adding a %require statement
in the grammar file.  Recent bison versions are easily available through Homebrew
and macports.

Simon


  parent reply	other threads:[~2019-12-18 16:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18 15:05 Tom Tromey
2019-12-18 16:21 ` Pedro Alves
2019-12-18 16:35   ` Tom Tromey
2019-12-18 16:38     ` Pedro Alves
2019-12-18 19:18     ` Christian Biesinger via gdb-patches
2019-12-19 18:11       ` Tom Tromey
2019-12-18 16:32 ` Simon Marchi [this message]
2019-12-18 16:37   ` Tom Tromey

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=19dacf6b-b2b4-8e60-20fc-5e0d3ba9dc35@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.com \
    /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