This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: generalized lvalues -- patch outline


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.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]