This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Handling of extern inline in c99 mode


On Wed, 1 Nov 2006, Andrew Pinski wrote:

> Also it would be nice to have an attribute or a new keyword to get the 
> old "extern inline" behavior, something like __extern_but_inline?  Or is 
> there a real equavilant with C99 style inling (I have not followed this 
> part close enough to figure that out).

The equivalent is plain "inline" BUT all file scope declarations of the 
inline function in the whole translation unit must use "inline" and not 
use "extern" (block scope ones not satisfying this are OK).  Thus

int foo();
inline int foo() { ... }

exports foo, as does

inline int foo() { ... }
// Declaration below might be a previously redundant one in user code.
extern int foo();

and this is what means it's not just a straight substitution in headers.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]