[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnugo-devel] inline

From: Arend Bayer
Subject: [gnugo-devel] inline
Date: Wed, 25 Sep 2002 20:17:31 +0200 (CEST)

Gunnar wrote:

> There has been some recent discussion on the list about inline, but it
> wasn't very conclusive. I think the major issues are:
> * Inline is a new feature in c99 and we are committed to c89.
> * Pre-c99 compilers often have an inline extension, but not
>   necessarily compatible with the c99 inline.
> * There are some limits to what can be inlined.

As far as I understand (mostly from the gcc documentation), gcc has
"extern inline" and "static inline". "extern inline" looks inappropriate
to me, and it is also apparently not C99-compliant. So let's
restrict to "static inline". These functions can get inlined only if
the function body comes before its use. If all calls to such a
functions do get inlined, then the function itself is removed from the
object file.

I'd be surprised if any compiler could come up with an incompatible
implementation to this (leaving aside the issue of variable number of
arguments which prevents VC from inlining according to Trevor).

I don't know how __inline__ would be treated by other compilers
(recommended in the gcc docs for inline use in ansi-compliant header

> A precondition for using inline at all is that we can determine
> whether it's supported through the configure mechanism. There's some
> research left to do in this area.

Test whether
"static inline int foo() { return 1; } int main() { if foo() exit; }"
or a similar non-sense can get compiled?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]