On Mon, 29 May 2000, Jeff Garzik wrote:
>
> 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 think that it should be included also some extra warning in Makefile:
-Winline -Wlong-long. In this manner developer know when inlining is
failing.
>
> > 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..
>
Sorry for my very bad English. I've wrote something wrong.
In include/linux/sched.h __mmdrop is declared as extern inline (note:
declared and not defined)
In kernel/sched.c __mmdrop is defined as inline.
In include/linux/sched.h the inline function mmdrop call __mmdrop and it
is used in some other files.
Thus note that compiler never know how is the inline function (but in
sched.c).
giacomo
-
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 May 31 2000 - 21:00:21 EST