From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4024 invoked by alias); 21 Dec 2004 19:01:16 -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 3972 invoked from network); 21 Dec 2004 19:01:09 -0000 Received: from unknown (HELO mail.codesourcery.com) (65.74.133.9) by sourceware.org with SMTP; 21 Dec 2004 19:01:09 -0000 Received: (qmail 14494 invoked from network); 21 Dec 2004 19:01:08 -0000 Received: from localhost (HELO taltos.codesourcery.com) (zack@127.0.0.1) by mail.codesourcery.com with SMTP; 21 Dec 2004 19:01:08 -0000 Received: by taltos.codesourcery.com (sSMTP sendmail emulation); Tue, 21 Dec 2004 11:01:08 -0800 To: Geoffrey Keating Cc: gcc@gcc.gnu.org Subject: Re: GTY and const References: <20041213203007.GA4907@localhost.localdomain> <87fz28enjk.fsf@codesourcery.com> From: Zack Weinberg Date: Tue, 21 Dec 2004 19:01:00 -0000 In-Reply-To: (Geoffrey Keating's message of "21 Dec 2004 10:26:59 -0800") Message-ID: <877jnbiih7.fsf@codesourcery.com> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-12/txt/msg00944.txt.bz2 Geoffrey Keating writes: >> > Would it be better to add a cast around the assignment or to make >> > the GTY code handle const members? >> >> I'd prefer that you improved gengtype. > > It's not gengtype, the problem really is that you cannot have const > GCed memory, for the same underlying reasons that you cannot free() a > const pointer. No, that's just plain not true. cpplib makes extensive use of 'const' to indicate write-once data structures (they are initialized through a non-const pointer, of course). Those definitely can be GC memory. zw