This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Inlining of vararg functions

Peter Simons wrote:
> Hi,
> just a few moments ago, I realized that gcc apparently cannot inline
> functions with variable arguments such as "void test(char*, ...)". Is
> there any particular reason why this is so? And is there any chance
> that this feature will be added to gcc (3.0?) in the near future? Do
> you by chance know whether other compilers can do this?
I think it quite unlikely that this will happen. With varadic functions,
the compiler has no knowledge of how the arguments are going to be
accessed (it's isomorphic to the halting problem). they essentially have
to be layed down in an array and accessed via a pointer. That
would have to still be done on inlining, and I suspect it would get

The one exception would be the empty function
	void foo (char *, ...)

which I guess might happen for debug type things with debugging disabled.

my feeling is that it is sufficiently rare for a varadic function call
to be worth inlining in the first place, that implementing that functionallity
would not be worth it.


Dr Nathan Sidwell   ::   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?' : :

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]