Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!mips!daver!ditka!qiclab!m2xenix!quagga!cspw From: cspw@quagga.uucp (Peter Wentworth) Newsgroups: comp.lang.c Subject: Re: How do I get the address of the current function? Message-ID: <7542@quagga.uucp> Date: 3 Jul 90 11:38:53 GMT References: <90Jun28.195353edt.19442@me.utoronto.ca> Organization: Dept. of Computer Science, Rhodes University Lines: 26 I solved a similar problem by using a macro expansion to generate the function headings: in my case all the routines had the same prototypes, and I was generating the C code automatically from another compiler. As part of the macro expansion you can 'undef' a compile time name, say CURR_FN, and redefine it. The expanded code for every function looked something like this #undef CURR_FN #define CURR_FN f void f(...) { use the address of CURR_FN as &CURR_FN } This is a horrible work-around, but it worked nicely for cases when I was generating the function bodies automatically. I don't believe there is any way to directly reference the current function without using its name. Pete -- EP Wentworth - Dept. of Computer Science - Rhodes University - Grahamstown. Internet: cspw.quagga@f4.n494.z5.fidonet.org Uninet: cspw@quagga uucp: ..uunet!m2xenix!quagga!cspw