[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto function binding on gcc?





J. Perkins wrote:
> I posted this on sweng-gamedev, but it's been pointed out that it
> probably belongs here.
> 
>  ---
> 
> After putting it off for a loooong time, I've been taking a
> look at Scott Bilas' paper on automatic function binding,
> the "FuBi" section of GPG1. This could save me a lot of
> keystrokes over my current system, but I've run into one
> stumbling block: gcc apparently doesn't store the return type
> in the mangled name. Has anyone tried this before? Is there
> a way to get the return type?

Probably not.

C++ allows you to overload functions by their parameter type.

   eg:

    double foobar ( int    param ) { ... }
    double foobar ( double param ) { ... }

...but it doesn't allow you to overload them by their return type.

   eg

    double foobar ( int param ) { ... }
    int    foobar ( int param ) { ... }  /* Illegal */

...hence there is no need to store the return type in the symbol table
and therefore there is no way to determine it from the mangled name.

----------------------------- Steve Baker -------------------------------
Mail : <sjbaker1@airmail.net>   WorkMail: <sjbaker@link.com>
URLs : http://www.sjbaker.org
        http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
        http://prettypoly.sf.net http://freeglut.sf.net
        http://toobular.sf.net   http://lodestone.sf.net