This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Inlining of vararg functions
- To: Peter Simons <peter dot simons at cw dot com>
- Subject: Re: Inlining of vararg functions
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Thu, 03 May 2001 10:09:38 +0100
- CC: gcc at gcc dot gnu dot org
- Organization: Codesourcery LLC
- References: <200105030836.f438aYc51152@dev13.de.cw.net>
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
hairy.
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.
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org