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, Nov 01, 2006 at 08:02:55AM -0800, Ian Lance Taylor wrote:
> 1) Implement a function attribute which is the equivalent of "extern
>    inline".  Backport support for this attribute to all open branches.
>    Try to persuade the glibc developers to use this feature instead of
>    "extern inline" when it is available, by adjusting the handling of
>    __USE_EXTERN_INLINES in features.h and elsewhere.

Backporting the attribute to all open branches isn't necessary,
glibc (and all other packages that use extern inline in their headers,
there are plenty of them) can conditionalize it on GCC version and
flags, something like:

/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
   inline semantics.  */
#if __GNUC_PREREQ (4,3) && defined (__STDC__VERSION__) \
    && __STDC_VERSION__ >= 199901L
# define __extern_inline __attribute__((__extern_inline__)) __inline
# define __extern_always_inline __attribute__((__extern_inline__)) __always_inline
#else
# define __extern_inline extern __inline
# define __extern_always_inline extern __always_inline
#endif

and just use __extern_inline or __extern_always_inline instead
of current uses of __inline resp. extern __always_inline.

	Jakub


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