Skip to contentSkip to conversation

__FUNCTION__ revisited

parisc-linux Grant Grundler 2 participants 2 messages Oct 26, 2000

lore
Share & tools
lore
#0 lore raw

Hi Ulrich,

After RTFMing for a bit, I still think __FUNCTION__ is b0rken. Maybe I'm doing something else stupid that's obvious to you.

In linux/arch/parisc/kernel/sba_ccio.c I have some debug output which can be enabled like this:

	#define DEBUG_SBA_RUN_SG

I use that for:

	#ifdef DEBUG_SBA_RUN_SG
	#define DBG_RUN_SG(x...)       printk(x)
	#else
	#define DBG_RUN_SG(x...)
	#endif

and use DBG_RUN_SG() like this:

	DBG_RUN_SG("%s() DONE %d mappings\n", __FUNCTION__, n_mappings);

The output I get looks like "() DONE 16 mappings". No complaints from compiler or linker.

And despite the official change of __FUNCTION__'s data type almost 2 years ago in the developement branch, __FUNCTION__ was still being treated as a literal by our tool chain as late as August 3, 2000.
I still have the c110 console output to prove it:
-rw-rw---- 1 grundler users 12384 Aug 3 19:35 c110.out1

thanks,
grant

#1 lore raw
Quoted 2 lines · Grant Grundler

After RTFMing for a bit, I still think __FUNCTION__ is b0rken. Maybe I'm doing something else stupid that's obvious to you.

I don't know what kind of problem you are seeing. It certainly works for me on x86, Arm, PPC. It's used in the implementation of assert() so it better should be. Maybe the compiler branch you are using is cut at an unfortunate moment when the people who are rewriting the preprocessor broke something.

Signature · 3 lines
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------