This is the mail archive of the gcc-patches@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: C99 inline semantics for GCC


On Tue, 9 May 2006, Jakub Jelinek wrote:

> On Tue, May 09, 2006 at 01:21:40AM -0700, Andrew Pinski wrote:
> > 
> > On May 9, 2006, at 1:18 AM, Geoffrey Keating wrote:
> > 
> > >This patch makes GCC's inline implementation, in C99 mode, closer to
> > >what C99 specifies.  It implements section 6.7.4 paragraph 6.
> > 
> > I should mention that GCC itself now depends on the old GNU extern
> > inline extension which might cause a problem when switching over to C99
> > by default.
> 
> Also glibc and many other packages heavily depend on it.
> So, at least there should be __attribute__((__extern_inline__)) or
> something similar to get the GNU extern inline behavior in C99 mode.

As a rough approximation, plain "inline" in C99 mode does something 
similar to "extern inline" in gnu89.  A difference is that all 
declarations in the translation unit must use "inline" without "extern".  
Thus you can't declare a standard function as inline in a header in C99 
mode (as a user redeclaration with extern would cause the user object to 
re-export the function), you need to do:

#define standard_function(x) __internal_function(x)
inline type __internal_function ...

I expect fixincludes will be needed to keep existing glibc headers working 
in C99 mode when this patch is applied.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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