[patch] don't give bodies for both 'extern inline' and normal versions of a function in same file

Alexandre Oliva aoliva@redhat.com
Tue Jul 20 09:29:00 GMT 2004


On Jul 19, 2004, Dan Kegel <dank@kegel.com> wrote:

> That might be, but the comments in http://gcc.gnu.org/PR14096 leave
> me with the impression that the gcc developers consider the source code
> invalid

The invalid bit is that, for a function only defined as extern inline,
an out of line definition is required because the address of the
function is taken.  I'm assuming, however, that the non-inline
definition wouldn't get the always_inline attribute.  Maybe I'm
assuming too much.  Let's see...

> Interesting.  It sounds like glibc will have to use 'static inline'
> instead of 'extern inline' eventually, if not for gcc-3.5.

But this change means you can't have both the static inline and the
external, non-inline definition available in the same translation
unit, which was the point of GCC's extension.

> The patch I posted should avoid this problem, too.

Exactly.  By removing the inlinable definition, IIUC.

> I bet you a nickel glibc will eventually apply my patch.

If GCC removes this useful extension, there won't be a way to express
it, and the patch will have to go in, yes.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}



More information about the Libc-alpha mailing list