From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30791 invoked by alias); 23 Nov 2004 18:30:35 -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 30633 invoked from network); 23 Nov 2004 18:30:27 -0000 Received: from unknown (HELO mailgate.urz.tu-dresden.de) (141.30.66.154) by sourceware.org with SMTP; 23 Nov 2004 18:30:27 -0000 Received: from [127.0.0.1] (helo=localhost) by mailgate.urz.tu-dresden.de with esmtp (exim-4.22) id 1CWfQo-0005pv-66; Tue, 23 Nov 2004 19:30:26 +0100 Received: from mailgate.urz.tu-dresden.de ([127.0.0.1]) by localhost (rks24 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22060-07; Tue, 23 Nov 2004 19:30:25 +0100 (MET) Received: from [141.30.17.64] (helo=ptprs1.phy.tu-dresden.de) by mailgate.urz.tu-dresden.de with esmtp (exim-4.22) id 1CWfQn-0005pQ-Gd; Tue, 23 Nov 2004 19:30:25 +0100 Received: from physik.tu-dresden.de (ptpp80.phy.tu-dresden.de [141.30.17.240]) by ptprs1.phy.tu-dresden.de (AIX4.3/8.9.3/8.9.3) with ESMTP id TAA03154; Tue, 23 Nov 2004 19:30:24 +0100 Message-ID: <41A381BF.80801@physik.tu-dresden.de> Date: Tue, 23 Nov 2004 18:57:00 -0000 From: Thomas Kunert User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 MIME-Version: 1.0 To: Nathan Sidwell CC: 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> <41A37F56.7020002@codesourcery.com> In-Reply-To: <41A37F56.7020002@codesourcery.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-TUD-Virus-Scanned: by amavisd-new at rks24.urz.tu-dresden.de X-TUD-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on rks24 X-SW-Source: 2004-11/txt/msg00837.txt.bz2 Nathan Sidwell wrote: > 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 > This doesn't work for C++, does it? TK.