Messages in this thread | | | Date | Wed, 3 Feb 1999 10:08:18 +0100 | From | "Martin v. Loewis" <> | Subject | Re: linux-2.2.1-ac3 and egcs-19990131 |
| |
> Gee, and I thought only C++ provided extern inline:
It seems that ISO C 99 has extern inline functions. 6.7.4/2 says
>> An inline definition of a function with external linkage shall not >> contain a definition of a modifiable object with static storage >> duration, and shall not contain a reference to an identifier with >> internal linkage.
And paragraph 6 says
>> For a function with external linkage, the following restrictions >> apply: If a function is declared with an inline function specifier, >> then it shall also be defined in the same translation unit.
I don't understand this entirely. It seems that there must be exactly one definition of such a function in a single translation unit, which is then used by other translation units. To me, this allows the following usage
/* foo.h */ inline void foo(){}
/* foo.c */ extern void foo(); /* Compiler emits out-of-line code in foo.o */
/* bar.c */ void bar(){ foo(); /* Inline call */ }
void* bar1(){ extern void foo(); return (void*)&foo; }
Any comments?
Martin
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |