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?
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: zack at codesourcery dot com (Zack Weinberg)
- Cc: zlaski at apple dot com (Ziemowit Laski), ebotcazou at libertysurf dot fr (Eric Botcazou), gcc at gcc dot gnu dot org (gcc List)
- Date: Fri, 18 Jun 2004 04:02:28 -0400 (EDT)
- Subject: Re: Why does casting a function generate a run-time abort?
>
> 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