Why does casting a function generate a run-time abort?

Richard Henderson rth@redhat.com
Fri Jun 18 23:08:00 GMT 2004


On Fri, Jun 18, 2004 at 03:53:04PM -0700, Ziemowit Laski wrote:
> Because at least you know what you're calling, instead of having to talk
> back to the front-end du jour to find out.

We know what we're calling -- a method.  It's the details of how
to find out exactly that method's address that's private to the
front end.

> >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.
> 
> Except that I _did_ do  it, using a code fragment you described as
> "overly complicated". :-)

No, you did NOT.  You wrote something that looked like C, but
was not semantically valid C.  Thus you did not write in C.

> >Would you make the same argument that C++ or Java or Ada must be
> >completely implementable in C?
> 
> Yes, of course I would; I am sure you have come across 'cfront' in the 
> past? :-)

Sure, as long as you don't care what the ABI looks like.  I'll bet
you cannot implement the current C++ ABI in strictly conforming C.

Do you really want to continue arguing about this?  You're not the
one that has to work on the optimizers, after all.


r~



More information about the Gcc mailing list