This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How should __attribute__ ((gnu_inline)) behave?
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc at gcc dot gnu dot org
- Date: 13 Feb 2007 18:21:41 -0800
- Subject: 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