From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96259 invoked by alias); 4 Jul 2018 15:51:17 -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 95545 invoked by uid 89); 4 Jul 2018 15:51:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*u:Webmail, H*UA:Roundcube, H*u:Roundcube, HContent-Transfer-Encoding:8bit X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Jul 2018 15:51:13 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w64Fp7M9017919 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 4 Jul 2018 11:51:11 -0400 Received: by simark.ca (Postfix, from userid 112) id 016021EF29; Wed, 4 Jul 2018 11:51:06 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id D9CE11E059; Wed, 4 Jul 2018 11:51:05 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 04 Jul 2018 15:51:00 -0000 From: Simon Marchi To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [RFC][gdb] Fix build error in macroexp.c In-Reply-To: <20180622071433.nsoekb62ctcluwap@localhost.localdomain> References: <20180622071433.nsoekb62ctcluwap@localhost.localdomain> Message-ID: <90b3c8a9708df6c8e91fdea36d7baf38@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00094.txt.bz2 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