public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: function name macro
@ 2003-12-02 20:21 Ramadass, Ramanathan
  0 siblings, 0 replies; 2+ messages in thread
From: Ramadass, Ramanathan @ 2003-12-02 20:21 UTC (permalink / raw)
  To: vu pham, gcc-help

Yep. Do "info gcc" on your system and go to the "Function Names" node. Here is the relevant text;

 GCC predefines two magic identifiers to hold the name of the current
function.  The identifier `__FUNCTION__' holds the name of the function
as it appears in the source.  The identifier `__PRETTY_FUNCTION__'
holds the name of the function pretty printed in a language specific
fashion.

Thanks
Ram

-----Original Message-----
From: vu pham [mailto:vu@sivell.com]
Sent: Tuesday, December 02, 2003 12:20 PM
To: gcc-help@gcc.gnu.org
Subject: function name macro


Hi all,

Is there any macro that produces the function name of the function that 
uses this macro ?

For example :

int foo( int a )
{
	printf( __FUNCTION_NAME__ " a = %d", a );
	. . .
}

Thanks,

Vu

^ permalink raw reply	[flat|nested] 2+ messages in thread

* function name macro
@ 2003-12-02 20:13 vu pham
  0 siblings, 0 replies; 2+ messages in thread
From: vu pham @ 2003-12-02 20:13 UTC (permalink / raw)
  To: gcc-help

Hi all,

Is there any macro that produces the function name of the function that 
uses this macro ?

For example :

int foo( int a )
{
	printf( __FUNCTION_NAME__ " a = %d", a );
	. . .
}

Thanks,

Vu

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-12-02 20:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-02 20:21 function name macro Ramadass, Ramanathan
  -- strict thread matches above, loose matches on Subject: below --
2003-12-02 20:13 vu pham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).