|[8 earlier articles]|
|Re: Optimizing empty functions in C email@example.com (Andrzej Wasowski) (2002-06-20)|
|Re: Optimizing empty functions in C firstname.lastname@example.org (Mark Lacey \[MSFT\]) (2002-06-20)|
|Re: Optimizing empty functions in C email@example.com (Diego Novillo) (2002-06-28)|
|Re: Optimizing empty functions in C firstname.lastname@example.org (Scott Nicol) (2002-06-28)|
|Re: Optimizing empty functions in C email@example.com (Hans Aberg) (2002-06-28)|
|Re: Optimizing empty functions in C firstname.lastname@example.org (Ralph Corderoy) (2002-06-28)|
|Re: Optimizing empty functions in C email@example.com (Dave Hansen) (2002-06-28)|
|Re: Optimizing empty functions in C Peter-Lawrence.Montgomery@cwi.nl (Peter L. Montgomery) (2002-06-28)|
|From:||"Dave Hansen" <firstname.lastname@example.org>|
|Date:||28 Jun 2002 18:12:06 -0400|
|References:||02-06-025 02-06-047 02-06-060|
|Posted-Date:||28 Jun 2002 18:12:06 EDT|
On 20 Jun 2002 21:43:34 -0400, "Andrzej Wasowski" <email@example.com>
>> IMO the key is "inline".
>Wait a moment. I meant *C* compilers not C++. Do you mean that there is
>a kind of automatic inilining employed for small functions in most of C
>[Not that I ever saw, unless you mean preprocessor macros. -John]
I don't know about "most" compilers. It depends on the
implementation. The compiler is allowed to inline functions as long
as it behaves "as-if" it hadn't.
FWIW, the Metaware High C compiler for protected mode x86 I used two
jobs ago compiled the following file:
static int square(int n)
mov eax, 9
Note that square is static and its address is never taken, so the
compiler didn't even bother to generate code for it.
Of course, C99 does have inline, though it's different than inline in
C++. And most C compilers don't (yet?) comply with C99.
Change is inevitable, progress is not.
Return to the
Search the comp.compilers archives again.