From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9883 invoked by alias); 21 Dec 2004 18:26:27 -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 9789 invoked from network); 21 Dec 2004 18:26:19 -0000 Received: from unknown (HELO mail-out3.apple.com) (17.254.13.22) by sourceware.org with SMTP; 21 Dec 2004 18:26:19 -0000 Received: from mailgate1.apple.com (a17-128-100-225.apple.com [17.128.100.225]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id iBLIXssP022016 for ; Tue, 21 Dec 2004 10:33:54 -0800 (PST) Received: from relay1.apple.com (relay1.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.3.17) with ESMTP id ; Tue, 21 Dec 2004 10:27:46 -0800 Received: from greed.local ([17.219.205.178]) by relay1.apple.com (8.12.11/8.12.11) with ESMTP id iBLIQC6l021796; Tue, 21 Dec 2004 10:26:12 -0800 (PST) Received: by greed.local (Postfix, from userid 501) id B3F7937AC0A; Tue, 21 Dec 2004 10:27:00 -0800 (PST) To: Zack Weinberg Cc: gcc@gcc.gnu.org Subject: Re: GTY and const References: <20041213203007.GA4907@localhost.localdomain> <87fz28enjk.fsf@codesourcery.com> From: Geoffrey Keating Date: Tue, 21 Dec 2004 18:26:00 -0000 In-Reply-To: <87fz28enjk.fsf@codesourcery.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2004-12/txt/msg00943.txt.bz2 Zack Weinberg writes: > Matt Kraai writes: > > > Howdy, > > > > One of the warnings that causes PR 18176 is an assignment of a const > > cpp_token * to the source member of the val union of the cpp_token > > structure, which is not const. According to the uses I've found, this > > member could be const, except that doing so causes warnings in > > gtype-desc.c, which does not preserve the const qualifier. > > > > 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.