From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom de Vries <tdevries@suse.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC][gdb] Fix build error in macroexp.c
Date: Wed, 04 Jul 2018 15:51:00 -0000 [thread overview]
Message-ID: <90b3c8a9708df6c8e91fdea36d7baf38@polymtl.ca> (raw)
In-Reply-To: <20180622071433.nsoekb62ctcluwap@localhost.localdomain>
On 2018-06-22 03:14, Tom de Vries wrote:
> Hi,
>
> When doing a combined build with the gcc and binutils-gdb repos, I run
> into
> this build error in gdb:
> ...
> gdb/macroexp.c: \
> In function âvoid get_next_token_for_substitution(macro_buffer*, \
> macro_buffer*, char**, macro_buffer*, char**, int*, bool*)â:
> gdb/macroexp.c:925:17: error: \
> implicitly-declared âconstexpr macro_buffer& \
> macro_buffer::operator=(const macro_buffer&)â is deprecated \
> [-Werror=deprecated-copy]
> *token = *lookahead;
> ...
>
> This patch fixes the build error by adding an explicit copy operator to
> the
> macro_buffer class. I've added asserts to ensure that both the dest
> and src
> of the copy are shared, in other words, neither is owner of the text
> pointer.
>
> I've run the gdb testsuite on x86_64-linux and the asserts did not
> trigger.
>
> Any comments?
Hi Tom,
Maybe just mention in the commit log that this new warning
(deprecated-copy) is present in recent gccs (> 8 I think?). LGTM with
the following nit fixed:
> diff --git a/gdb/macroexp.c b/gdb/macroexp.c
> index 1fa37d2875..8b4dfb20b8 100644
> --- a/gdb/macroexp.c
> +++ b/gdb/macroexp.c
> @@ -112,6 +112,16 @@ struct macro_buffer
> shared = true;
> }
>
> + macro_buffer& operator=(const macro_buffer &src)
Missing space before parenthesis.
Thanks,
Simon
prev parent reply other threads:[~2018-07-04 15:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-22 7:14 Tom de Vries
2018-07-03 14:22 ` [PING][RFC][gdb] " Tom de Vries
2018-07-04 15:51 ` Simon Marchi [this message]
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=90b3c8a9708df6c8e91fdea36d7baf38@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).