This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: generalized lvalues -- patch outline
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: Gabriel Dos Reis <gdr at integrable-solutions dot net>, Daniel Berlin <dberlin at dberlin dot org>, Nathan Sidwell <nathan at codesourcery dot com>, Ziemowit Laski <zlaski at apple dot com>, Steve Naroff <snaroff at apple dot com>, gcc mailing list <gcc at gcc dot gnu dot org>, Matt Austern <austern at apple dot com>, Joe Buck <joe dot buck at synopsys dot com>, Andrew Pinski <pinskia at physics dot uc dot edu>, Mike Stump <mrs at apple dot com>
- Date: Tue, 23 Nov 2004 17:09:16 +0100
- Subject: Re: generalized lvalues -- patch outline
- References: <4D2CF60C-3919-11D9-8BD2-000A95BCF344@apple.com> <9CD04F70-3CC6-11D9-B847-000D9330C50E@apple.com> <41A253A2.1050205@codesourcery.com> <24BB97A2-3CD3-11D9-B847-000D9330C50E@apple.com> <41A30346.8050602@codesourcery.com> <Pine.LNX.4.58.0411231244000.29201@wotan.suse.de> <Pine.LNX.4.60.0411230833250.16150@dberlin.org> <Pine.LNX.4.58.0411231541340.29201@wotan.suse.de> <m37jocr2k7.fsf@uniton.integrable-solutions.net> <Pine.LNX.4.58.0411231650120.29201@wotan.suse.de>
- Reply-to: Richard Guenther <richard dot guenther at gmail dot com>
On Tue, 23 Nov 2004 16:57:58 +0100 (CET), Michael Matz <matz@suse.de> wrote:
>
>
> Hi,
>
> On Tue, 23 Nov 2004, Gabriel Dos Reis wrote:
>
> >
> > Probably, this sort of situations probably happen because some people
> > have been encouraged in conceiving programming as an activity of
> > throwing random codes to the compiler and see what happens.
>
> Possible. This is one of the ways to learn programming. And despite what
> the language standard says, to my eyes "(T*)p++" looks like a natural way
> to write p+=sizeof(T), so I'm somewhat sympathetic to programmers using
> this construct.
Especially as it would need
p = (__typeof__(p))((char *)p + sizeof(T));
If you restrict *(T*)p++ to p of char* or void* type, how many broken packages
would be left? I think at least those should be fixed.
Richard.
> Ciao,
> Michael.
>