#define PRINT_FUNC()
{
// i am looking for this
}
void foo(int i, double d)
{
PRINT_FUNC();
}
void main()
{
foo(1, 1.0);
}
==============================
output:
void foo(1, 1.0);
==============================
isn't it nice? ;-)
__PRETTY_FUNCTION__ is not very useful(i think)
by this way it will be possible to output a stacktrace nicely
--- In [email protected], "Nico Heinze" <[EMAIL PROTECTED]> wrote:
>
> --- In [email protected], "Indika Bandara" <indikabandara19@>
> wrote:
> >
> > Hi,
> >
> > i've read that va_xxx functions are macros which do some
> > stack manipulation to get the arguments. can somebody
> > help me in pointing to where they are implemented.
> > couldn't find after googling:-(
> >
> > actually i'm looking to find a way to get the arguments
> > to a function e.g argument count etc.
>
> Argument count: no way (except e.g. using a format string as in the
> printf() family and hoping that the programmer provided a correct
> format string which exactly resembles the parameters passed to your
> function).
> Argument values: could you please give an example of what you're
> trying to do? The man pages for va_arg gives enough examples to get
> you started, but to me it sounds as if you have something different in
> mind, hence the question for an example.
>
> Regards,
> Nico
>