From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8870 invoked by alias); 12 Oct 2004 23:13:25 -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 8860 invoked from network); 12 Oct 2004 23:13:24 -0000 Received: from unknown (HELO disaster.jaj.com) (24.123.75.82) by sourceware.org with SMTP; 12 Oct 2004 23:13:24 -0000 Received: from disaster.jaj.com (localhost.localhost [127.0.0.1]) by disaster.jaj.com (8.12.10/8.12.10) with ESMTP id i9CNDBip028006; Tue, 12 Oct 2004 19:13:11 -0400 Received: (from phil@localhost) by disaster.jaj.com (8.12.10/8.12.9/Submit) id i9CNDACU028005; Tue, 12 Oct 2004 19:13:10 -0400 Date: Wed, 13 Oct 2004 02:53:00 -0000 From: Phil Edwards To: Zack Weinberg Cc: Gabriel Dos Reis , Geoffrey Keating , Ranjit Mathew , gcc@gcc.gnu.org Subject: Re: Compiling GCC With a C++ Compiler (g++) Message-ID: <20041012231310.GA27836@disaster.jaj.com> References: <416B89F2.1030606@gmail.com> <87brf735or.fsf@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87brf735or.fsf@codesourcery.com> User-Agent: Mutt/1.5.4i X-SW-Source: 2004-10/txt/msg00471.txt.bz2 On Tue, Oct 12, 2004 at 03:57:56PM -0700, Zack Weinberg wrote: > Gabriel Dos Reis writes: > > > Geoffrey Keating writes: > > | The 'const' is there to indicate that the string should not be changed > > | once the STRING_CST is created; > > > > And how do you create it? > > By casting away the const, as is done in build_string. Or by > constructing the data in memory before giving it the type with the > const qualifier. The normal creation process is to do the second approach of the ones you listed. The difference is that for C++, that can only be done in one particular place. Since member init-lists aren't available for STRING_CST, we have to cast away the const in build_string -- which essentially plays the role of a C++ constructor. The const should stay; C is not C++, and the way in which write-once constructs are created is just plain /different/ at the source level. Until we can agree that we should be able to use C++ in the compiler, this thrashing around trying to make the source acceptable in both languages is just going to produce heat and noise. > How else do you propose to enforce write-once semantics on a data > structure that is, in fact, write-once? I am definitely with Geoff > here - this should be allowed (or, to rephrase, if C++ has no > construct which allows what we want to do here, that is a language > deficiency). It does, but only for member functions. So we can't go there. Phil -- Behind everything some further thing is found, forever; thus the tree behind the bird, stone beneath soil, the sun behind Urth. Behind our efforts, let there be found our efforts. - Ascian saying, as related by Loyal to the Group of Seventeen