[lsb-discuss] Does the standard “Function Calling Sequence” described in Sys V ABI specs (both i386 and AMD64) also applies to the static C functions?

Alan Cox alan at llwyncelyn.cymru
Fri Dec 28 13:06:24 UTC 2018


On Fri, 28 Dec 2018 20:10:43 +0800
Remus Clearwater <remus.clearwater at gmail.com> wrote:

> Sorry to repost (to make a better type setting).
> 
> --
> 
> I am sure that the standard "Function Calling Sequence" described in Sys V
> ABI specs (both i386 and AMD64) constraints the calling of those extern
> functions in a C library, but does it constraints the calling of those
> static functions too?

In some cases it has to:

static int foo (int bar)
{
	return bar + baz;
}

void wibble(struct ops *op)
{
	ops->foo = foo;
}

In other cases it demonstrably does not because gcc will in fact inline
the entire static function and it will never even appear in the code.

Alan


More information about the lsb-discuss mailing list