This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: generalized lvalues
On Nov 18, 2004, at 3:28 PM, Ziemowit Laski wrote:
Since objPtr is a plain-vanilla 'void *', it is not in general subject
to the new NeXT runtime GC regime. However, if we happen to assign a
pointer to an ObjC instance to it, then we do want to give a hint to
the compiler that objPtr _should_ be tracked by GC. 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.
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.
Yes, if we discover that removing it caused major problems then we
might be forced to consider doing that work. But we'd better be aware
that at this point you aren't proposing that we avoid doing something,
you're proposing a project to add functionality that isn't here.
--Matt