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;