This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: generalized lvalues
Matt Austern <austern@apple.com> writes:
> On Nov 18, 2004, at 3:28 PM, Ziemowit Laski wrote:
>> The most straighforward -- and intuitive -- way of doing this is
>> precisely via a cast applied to the lvalue, as seen above (with
>> '__strong' expanding to an appropriate attribute). While we have
>> investigated some syntactic alternatives to the cast in light of
>> the impending lvalue cast removal, all of them are counterintuitive
>> in that they fail to express what is being done -- namely, altering
>> the type of a variable for a particular assignment.
I would like to point out that in *my* arrogant opinion, this use of
lvalue casts is completely *un*intuitive; I would prefer either
declaring the void * with the "this is a GC root" attribute in the
first place, e.g.
id object;
void *__gcroot ptr;
...
ptr = object;
or (if for some reason that is impossible) a builtin function call,
e.g.
id object;
void *ptr;
...
__builtin_gc_register(ptr);
ptr = object;
> Just a reminder: the word "impending" isn't quite right. It's not that
> cast-as-lvalue isn't going away, but that it's already gone. It won't
> come back unless someone does the work to put it back, including
> documentation, testing, and integration with the 4.0 back end.
Not only that, but unless someone brought a *very* compelling argument
to the table, we wouldn't even consider it for 4.0 - the time for
adding features to 4.0 was six months ago.
zw