This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Handling of extern inline in c99 mode
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: Ian Lance Taylor <iant at google dot com>, Steven Bosscher <stevenb dot gcc at gmail dot com>, Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Wed, 1 Nov 2006 23:06:20 +0000 (UTC)
- Subject: Re: Handling of extern inline in c99 mode
- References: <200611012252.kA1MqSrR019707@localhost.localdomain>
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