How should __attribute__ ((gnu_inline)) behave?

Ian Lance Taylor iant@google.com
Wed Feb 14 02:22:00 GMT 2007


Should __attribute__ ((gnu_inline)) be treated the same as a gnu89
extern inline definition?  Or should the extern part be optional?
That is, should there be a difference between these two definitions?

  extern __attribute__ ((gnu_inline)) inline int foo () { return 0; }
  __attribute__ ((gnu_inline)) inline int foo () { return 0; }

In GNU89 mode, an inline function which is neither extern nor static
is output as an ordinary externally visible function.  In C99 mode,
such a function is not output as externally visible, though it may be
output as a file static function.

So we could permit __attribute__ ((gnu_inline)) to adjust what it does
based on whether the function is declared extern or not.  Or we could
say that __attribute__ ((gnu_inline)) always generates a GNU89 "extern
inline" function.

Any opinions?

Ian



More information about the Gcc mailing list