From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26620 invoked by alias); 23 Nov 2004 15:15:03 -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 26544 invoked from network); 23 Nov 2004 15:14:59 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sourceware.org with SMTP; 23 Nov 2004 15:14:59 -0000 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 4A55B11595D0; Tue, 23 Nov 2004 16:14:58 +0100 (CET) Date: Tue, 23 Nov 2004 15:47:00 -0000 From: Michael Matz To: Andrew Pinski Cc: Steve Naroff , gcc mailing list , Matt Austern , Daniel Berlin , Ziemowit Laski , Nathan Sidwell , Joe Buck , Mike Stump Subject: Re: generalized lvalues -- patch outline In-Reply-To: <4D0584E2-3D61-11D9-AEB4-000A95D692F4@physics.uc.edu> Message-ID: References: <4D2CF60C-3919-11D9-8BD2-000A95BCF344@apple.com> <20041117212847.A26376@synopsys.com> <6F5FC748-7BBD-44B9-8DDC-246949F16102@apple.com> <20041118102741.A8347@synopsys.com> <77E8D36A-C0C2-4B03-964C-BEE0FE7BBBC3@apple.com> <98C86CD4-39E2-11D9-B2D5-000A95BCF344@apple.com> <20041119170011.A30410@synopsys.com> <9E6AD708-3A93-11D9-9070-000D9330C50E@apple.com> <20041119174042.A1311@synopsys.com> <90DC5074-3A96-11D9-9070-000D9330C50E@apple.com> <9CD04F70-3CC6-11D9-B847-000D9330C50E@apple.com> <41A253A2.1050205@codesourcery.com> <24BB97A2-3CD3-11D9-B847-000D9330C50E@apple.com> <41A30346.8050602@codesourcery.com> <4D0584E2-3D61-11D9-AEB4-000A95D692F4@physics.uc.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-11/txt/msg00813.txt.bz2 Hi, On Tue, 23 Nov 2004, Andrew Pinski wrote: > if you had the following: > > ((int*)a)++; > > the better idea would be: > > char *a1 = (char*)a; > a1 += sizeof(int)/sizeof(char); > a = (typeof(a))(a1); Ah, yes ;-) I disagree. The better idea would have been if the C language would allow for the first construct. It's shorter, and by giving this rewriting rule seems also to be easy to define. Ciao, Michael.