Re: Calling function name
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Mon, 06 Jun 2005 18:51:36 GMT
junky_fellow@xxxxxxxxxxx writes:
> Saroj wrote:
>> Is there an way for a function to know who called him ?
>
> I think it cannot be done portably. You will need to write
> an implementation specific code for that.
> You will need to know the C calling convention for that
> architecture. For eg. in PowerPC, when a function is called
> the return address is put in Link Register (LR).
That will, at best, give you the address of the caller, not its name.
Anything like that is horrendously non-portable, and probably not
worth the effort. If that's the solution, try to redefine the
problem.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- References:
- Calling function name
- From: Saroj
- Re: Calling function name
- From: junky_fellow
- Calling function name
- Prev by Date: Re: is variant-length array declaration standard compatible?
- Next by Date: usenet wisdom (was:How to read data from an excel file by C?)
- Previous by thread: Re: Calling function name
- Next by thread: Re: Calling function name
- Index(es):
Relevant Pages
|