From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19745 invoked by alias); 10 Jun 2008 14:47:35 -0000 Received: (qmail 19724 invoked by uid 22791); 10 Jun 2008 14:47:34 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Jun 2008 14:47:14 +0000 Received: from zps36.corp.google.com (zps36.corp.google.com [172.25.146.36]) by smtp-out.google.com with ESMTP id m5AEksB7016063; Tue, 10 Jun 2008 15:46:54 +0100 Received: from smtp.corp.google.com (spacemonkey1.corp.google.com [192.168.120.115]) by zps36.corp.google.com with ESMTP id m5AEkrI5024934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 10 Jun 2008 07:46:53 -0700 Received: from localhost.localdomain.google.com (69-36-227-135.cust.layer42.net [69.36.227.135] (may be forged)) (authenticated bits=0) by smtp.corp.google.com (8.13.8/8.13.8) with ESMTP id m5AEknKN023064 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 10 Jun 2008 07:46:52 -0700 To: Joern Rennecke Cc: "Kaveh R. Ghazi" , gcc@gcc.gnu.org Subject: Re: constified note_stores References: <20080609224328.GK32358@elsdt-razorfish.arc.com> <13D82723C9864E9C93CA351786EAE74C@glap> <20080610133836.GL32358@elsdt-razorfish.arc.com> From: Ian Lance Taylor Date: Tue, 10 Jun 2008 14:47:00 -0000 In-Reply-To: <20080610133836.GL32358@elsdt-razorfish.arc.com> (Joern Rennecke's message of "Tue\, 10 Jun 2008 14\:38\:36 +0100") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2008-06/txt/msg00237.txt.bz2 Joern Rennecke writes: > Having another copy of note_stores seems simpler and is certainly > more portable. > What do you think about the name walk_stores? Following this approach strictly leads to considerable code duplication, which makes people unhappy. If you want to make an argument for just using it for note_stores, I'm willing to listen. I think the new name should be tied to note_stores, though--e.g., note_stores_nonconst. It's definitely a problem in C that some functions reasonably take const pointers in some cases and non-const pointers in other cases. But I think it's a well understood problem, and I think CONST_CAST_RTX, or small structures, are acceptable approaches. Obviously if we had to use CONST_CAST_RTX everywhere something would be wrong, but I only count six uses in the core code right now, which seems like an acceptable compromise. Ian