From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31895 invoked by alias); 23 Nov 2004 16:50:30 -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 31841 invoked from network); 23 Nov 2004 16:50:22 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sourceware.org with SMTP; 23 Nov 2004 16:50:22 -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 4DD2E115A49B; Tue, 23 Nov 2004 17:50:21 +0100 (CET) To: Paul Koning Cc: ebotcazou@libertysurf.fr, 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> From: Andreas Schwab X-Yow: .. I think I'd better go back to my DESK and toy with a few common MISAPPREHENSIONS... Date: Tue, 23 Nov 2004 17:16:00 -0000 In-Reply-To: <16803.26864.624255.231502@gargle.gargle.HOWL> (Paul Koning's message of "Tue, 23 Nov 2004 11:44:32 -0500") Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2004-11/txt/msg00826.txt.bz2 Paul Koning writes: >>>>>> "Eric" == Eric Botcazou writes: > > >> The average C programmer would not have thought to use this > >> extension unless they just decided one day to try it or they > >> actually read the gcc documentation (which I know almost nobody > >> does). > > Eric> I disagree: *((int *)p)++ was accepted by virtually all the > Eric> good old compilers: GCC 2.x, Microsoft, Borland, Watcom. This > Eric> is a natural idiom when you're manipulating images with > Eric> different color depths ... > > ... or doing alignment-optimized copying. I've seen this notation in > our code, and I'm pretty sure the author didn't get it from the GCC > docs. It's a natural thing to write -- unless you ARE a language > lawyer and understand the hairy details of precisely what is an lvalue > and what is not. ... and what strict aliasing can do to ruin your code. :-) Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."