generalized lvalues -- patch outline
Michael Matz
matz@suse.de
Tue Nov 23 15:47:00 GMT 2004
Hi,
On Tue, 23 Nov 2004, Andrew Pinski wrote:
> if you had the following:
>
> ((int*)a)++;
>
> the better idea would be:
>
> char *a1 = (char*)a;
> a1 += sizeof(int)/sizeof(char);
> a = (typeof(a))(a1);
Ah, yes ;-)
I disagree. The better idea would have been if the C language would allow
for the first construct. It's shorter, and by giving this rewriting rule
seems also to be easy to define.
Ciao,
Michael.
More information about the Gcc
mailing list