Re: [PATCH] Two small corrections to 2.4.0-test1

From: Tom Leete (tleete@mountain.net)
Date: Fri Jun 02 2000 - 03:54:27 EST


Jeff Garzik wrote:
>
> Giacomo Catenazzi wrote:
> >
[...]
> > -extern void inline __set_64bit_constant (unsigned long long *ptr,
> > +extern inline void __set_64bit_constant (unsigned long long *ptr,
> > unsigned long long value)
[...]
>
> The examples you cite, above, should be converted to "static inline",
> from "static __inline__" and "extern inline". Changing from 'extern
> inline' to 'static inline' is a long term project of mine, because
> 'extern inline' sometimes doesn't really inline.
>
> > I've found this warning (with some extra warning gcc options):
> >
> > : /usr/src/4linux/include/linux/sched.h: In function `mmdrop':
> > : /usr/src/4linux/include/linux/sched.h:642: warning: can't inline call to
> > : `__mmdrop'
> > : /usr/src/4linux/include/linux/sched.h:646: warning: called from here
>
> > If you lock the source, you see something strange:
> > __mmdrop is only declared inline (I think that it is not allowed by ANSI
> > C), inline are to be defined. __mmdrop is defined in kernel/fork.c . Thus
> > it can never included in linux/sched.h as inline. Magically linker don't
> > issue any errors.
>
> Maybe it shouldn't be inlined at all then. Take a look at where it's
> called in fork.c -- if that code is a "hot spot" then it should be left
> alone probably..
>
> Jeff
>

Why s/__inline__/inline/g? In current gcc they are
synonymous keywords. ANSI passed C99 last week, which will
break gnuish assumptions about 'inline'. I'm campaigning for
s/inline/__inline__/g.

I expect gcc to honor this sooner rather than later, since
it can mainly be gotten from existing g++ code. In g++,
'inline' is standard C++, '__inline__' is gnuish. I imagine
gcc will inherit that convention.

I don't understand your extern->static campaign. The two
have quite different behaviors and should be chosen
carefully. In particular, taking the address of a 'static
inline' function prevents its inlining anywhere. In any
case, inline is only a hint to the compiler.

Regards,
Tom

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:14 EST