This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Why does casting a function generate a run-time abort?
On Fri, Jun 18, 2004 at 03:03:24PM -0700, Ziemowit Laski wrote:
> Why not?
Because it's overly complicated in ways that don't help at all.
> Of course, you do realize that objc_msgSend is not the only entry point
> we'd need to handle in this fashion?
Ok, so?
> Do you want to have a different METHOD_EXPR for each of them (and for
> new entry points that the GNU and/or NexT runtimes may throw your way
> in the future)?
Aside from the exact set of places that METHOD_EXPR can be found
in gimple, the meaning of METHOD_EXPR is entirely private to the
front end. Thus you can have it expand to anything that the
front end cares to do.
This argument, imo, misses the point.
> Perhaps a more generic solution would involve a CAST_CALL_EXPR, where
> one of the arguments is the function to be called (objc_msgSend in our
> example), and another the signature to use for this particular call.
> Still redundant (at least of ObjC), but at least more sane. :-)
In what way is this sane?
> >I think you definitely want to NOT think about things you could sort-of
> >represent with C.
>
> Why not? I think you absolutely _do_ want to do this ...
Because you're NOT WRITING C. Because you're ALREADY outside the
semantics of the C language, and so ...
> for it guarantees
> that ObjC is as portable as the C language underneath it.
... this says that you CAN NOT do what you're trying to do.
Would you make the same argument that C++ or Java or Ada must be
completely implementable in C? If not, why are you arguing that
way for Objective C?
r~