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]

How should __attribute__ ((gnu_inline)) behave?


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


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