Why does casting a function generate a run-time abort?
Andrew Pinski
pinskia@physics.uc.edu
Fri Jun 18 08:02:00 GMT 2004
>
> Ziemowit Laski <zlaski@apple.com> writes:
>
> > Right; there is an ugly 'if(!c_dialect_objc())' in front of the whole
> > thing. Although I do see that an abort is indeed permitted under the
> > circumstances, I'm still mystified as to why this became an issue in
> > the first place. Why not just construct a function call using the
> > signature specified in the cast? Aside from not being able to inline
> > the call, I'm not quite sure what the problem is...
>
> A desire to flush out buggy code that *will* fail on platforms with
> more complicated ABIs, I think, is the main motivation.
>
> Lemme ask you why Objective-C message dispatch needs this. It's
> impossible to get "right" on IA64 and a few others.
It is only needed with the NeXT^wApple runtime :) so ...
The GNU runtime does not produce these casts at all and is safe.
Thanks,
Andrew Pinski
More information about the Gcc
mailing list