[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Auto function binding on gcc?
On Mon, Jun 10, 2002 at 07:40:57PM -0500, Steve Baker wrote:
>
>
> 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.
Could you not just process the C++ header to generate a "function
definitions list" file? Use perl or something?