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


Michael Matz <matz@suse.de> writes:

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

Short is good, when it does not introduce confusion and unnecessary
complexity. 
Specialized macros for such questionable constructs are better.

-- Gaby


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