From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91251 invoked by alias); 1 Nov 2017 14:00:15 -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 89430 invoked by uid 89); 1 Nov 2017 14:00:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= 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, 01 Nov 2017 14:00:01 +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 vA1Dxte7024636 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 1 Nov 2017 09:59:59 -0400 Received: by simark.ca (Postfix, from userid 112) id 20B691E526; Wed, 1 Nov 2017 09:59:55 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id F10BA1E4F3; Wed, 1 Nov 2017 09:59:38 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 01 Nov 2017 14:00:00 -0000 From: Simon Marchi To: Yao Qi Cc: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH 6/8] const-fy regcache::m_aspace In-Reply-To: <86d152xrl0.fsf@gmail.com> References: <1509096702-12202-1-git-send-email-yao.qi@linaro.org> <1509096702-12202-7-git-send-email-yao.qi@linaro.org> <75902364-b335-e37e-75e8-db5a0ff969c3@ericsson.com> <86d152xrl0.fsf@gmail.com> Message-ID: <7f4bb93d7518f57556791bb93aad6360@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.2 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 1 Nov 2017 13:59:55 +0000 X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00009.txt.bz2 On 2017-11-01 05:42, Yao Qi wrote: > Simon Marchi writes: > >> I don't really understand what this patch tries to achieve. From the >> description above, I thought you wanted to make the m_aspace field >> const, >> not the pointed object. >> > > I want to achieve both, the field m_aspace is a const, and the pointed > object is const too. > > /* The address space of this register cache (for registers where it > makes sense, like PC or SP). */ > - struct address_space *m_aspace; > + const address_space * const m_aspace; Ah ok I had missed that there was two consts added. >> If constifying the pointed address_space object is really what you >> meant to >> do, I find having the const_cast more confusing than anything else. I >> think >> we should constify all the way (removing const_casts, putting more >> consts >> where needed) or not at all. > > OK, const_cast is removed in the updated patch, what do you think? LGTM!