sizeof(function) functionality

Ben Davis bndavis@ntlworld.com
Wed Jul 9 02:18:00 GMT 2003


On Tuesday 8 July 2003 11:20 pm, Alexandre Oliva wrote:
> > DEFINE_SIZED_FUNCTION(float, myfunc, (float x, float y), {
> >     return (float)sqrt(x*x + y*y);
> > })
>
> Beware!
>
> DEFINE_SIZED_FUNCTION(float, myfunc, (float x, float y), {
>   float x2 = x*x, y2 = y*y;
>              // ^ oops, this is not a macro argument separator
>   return (float)sqrt(x2+y2);
> }

You're right - it gives an error (even with the ")" added after the "}"). I 
thought the { } would protect it.

Do you have a suggestion for how to make this work?

Ben



More information about the Gcc-help mailing list