|[8 earlier articles]|
|Re: Optimizing empty functions in C firstname.lastname@example.org (Andrzej Wasowski) (2002-06-20)|
|Re: Optimizing empty functions in C email@example.com (Mark Lacey \[MSFT\]) (2002-06-20)|
|Re: Optimizing empty functions in C firstname.lastname@example.org (Diego Novillo) (2002-06-28)|
|Re: Optimizing empty functions in C email@example.com (Scott Nicol) (2002-06-28)|
|Re: Optimizing empty functions in C firstname.lastname@example.org (Hans Aberg) (2002-06-28)|
|Re: Optimizing empty functions in C email@example.com (Ralph Corderoy) (2002-06-28)|
|Re: Optimizing empty functions in C firstname.lastname@example.org (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" <email@example.com>|
|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" <firstname.lastname@example.org>
>> 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.