From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26470 invoked by alias); 13 Oct 2004 13:09:57 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 26429 invoked from network); 13 Oct 2004 13:09:53 -0000 Received: from unknown (HELO merlin.cs.tamu.edu) (24.250.169.187) by sourceware.org with SMTP; 13 Oct 2004 13:09:53 -0000 Received: by merlin.cs.tamu.edu (Postfix, from userid 500) id 6057635551; Wed, 13 Oct 2004 08:09:52 -0500 (CDT) To: Ranjit Mathew Cc: Phil Edwards , Geoffrey Keating , gcc@gcc.gnu.org Subject: Re: Compiling GCC With a C++ Compiler (g++) References: <416B89F2.1030606@gmail.com> <87brf735or.fsf@codesourcery.com> <20041012231310.GA27836@disaster.jaj.com> <39399b9d04101222494b6e242b@mail.gmail.com> From: Gabriel Dos Reis In-Reply-To: <39399b9d04101222494b6e242b@mail.gmail.com> Organization: Texas A&M University, Department of Computer Science Date: Wed, 13 Oct 2004 13:29:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-10/txt/msg00500.txt.bz2 Ranjit Mathew writes: | In this particular case, we can probably resolve this | issue by removing "const" from tree_string but adding | "(const char *)" to the definition of TREE_STRING_POINTER | so that for "properly behaving" clients of a STRING_CST, | it is still a constant. That is the immediat way I would solve this. What we want to prevent is accidental modification. So the "(const char*)" belongs to the accessor. This tree_string is going to be put in a union where a priori we do not know which is going to be accessed; so the const cannot belong to the object. However, we can make sure that anybody who access that field have the illusion of non-modyfiability. -- Gaby