From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21038 invoked by alias); 23 Nov 2004 18:20:19 -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 21016 invoked from network); 23 Nov 2004 18:20:14 -0000 Received: from unknown (HELO mail.codesourcery.com) (65.74.133.9) by sourceware.org with SMTP; 23 Nov 2004 18:20:14 -0000 Received: (qmail 24580 invoked from network); 23 Nov 2004 18:20:13 -0000 Received: from localhost (HELO ?192.168.189.167?) (nathan@127.0.0.1) by mail.codesourcery.com with SMTP; 23 Nov 2004 18:20:13 -0000 Message-ID: <41A37F56.7020002@codesourcery.com> Date: Tue, 23 Nov 2004 18:30:00 -0000 From: Nathan Sidwell Organization: Codesourcery LLC User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 MIME-Version: 1.0 To: Thomas Kunert CC: Paul Koning , gcc@gcc.gnu.org Subject: Re: generalized lvalues -- patch outline References: <4D2CF60C-3919-11D9-8BD2-000A95BCF344@apple.com> <4D0584E2-3D61-11D9-AEB4-000A95D692F4@physics.uc.edu> <200411231728.58506.ebotcazou@libertysurf.fr> <16803.26864.624255.231502@gargle.gargle.HOWL> <41A37B13.9040100@physik.tu-dresden.de> In-Reply-To: <41A37B13.9040100@physik.tu-dresden.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-11/txt/msg00835.txt.bz2 Thomas Kunert wrote: > A union is the correct solution. > > union { > char* c; > int* i; > short* s; > } p; > > *p.i++; This suggests an excellent model for describing this extension. The lvalue cast behaves as if the object is a union of two fields. One field with the original type and the other field with the cast-to type. nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk