🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49956

inlining varargs functions

#49956
From: Marty Leisner 25733
Date: Tue, 30 Nov 1993 20:13
50 lines
1472 bytes
gcc 2.4.5 doesn't inline prototyped varargs functions or unprototyped
functions...

What I'm doing is something like:


	#ifndef __
	#define __(A) A  
	#endif

	#ifdef DEBUG
	int debug = 1;
	#define DEBUG_MESSAGE(x)	{ if(debug) printf __(x); }
	#else
	#define DEBUG_MESSAGE(x)	
	#endif

	main()
	{
		int i = 5;
		DEBUG_MESSAGE(("this is a test %s %d", __FUNCTION__, i));
	}


What I want to do is:

#ifdef DEBUG
static inline void debug_message(...)
{
	some code
}
#else
static inline void debug_message()
{	/* empty */
}
#endif

and let the optimizer remove debug_message if !DEBUG.
	






--
marty
leisner@sdsp.mc.xerox.com leisner.henr801c@xerox.com 
Member of the League for Programming Freedom
"I just know I'm a better manager when I have Joe DiMaggio in center field" -- Casey Stengel
Technical Details
Message-ID: <1993Nov30.201347.12879@spectrum.xerox.com>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!darwin.sura.net!news-feed-1.peachnet.edu!concert!rutgers!rochester!rocksanne!gnu!leisner

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,462a7769180e2e06,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-11-30 18:36:52 PST
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!darwin.sura.net!news-feed-1.peachnet.edu!concert!rutgers!rochester!rocksanne!gnu!leisner
From: leisner@gnu (Marty Leisner 25733)
Newsgroups: gnu.gcc.help
Subject: inlining varargs functions
Message-ID: <1993Nov30.201347.12879@spectrum.xerox.com>
Date: 30 Nov 93 20:13:47 GMT
Sender: news@spectrum.xerox.com
Reply-To: leisner@sdsp.mc.xerox.com
Organization: Xerox
Lines: 50
X-Newsreader: TIN [version 1.2 PL2]