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 06:01:10PM -0700, Ziemowit Laski wrote:
> Since the standard does not define the semantics of the call,
> we may as well let it through. I believe that is standard-conforming.
You're wrong.
# 6.5.2.2:
# 9 If the function is defined with a type that is not compatible with the
# type (of the expression) pointed to by the expression that denotes the
# called function, the behavior is undefined.
> Just what exactly is wrong with the asm() trick I came up with? I am,
> of course, asking for technical arguments, not aesthetic ones.
Technical argument? How about needless creation of FUNCTION_DECLs.
I'd have thought the aesthetic argument was good enough, however.
r~