From: Arnd Bergmann <arnd@arndb.de>
To: Andrew Grover <andy.grover@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: "extern inline" purge? was: Re: [PATCH] fix "extern inline"
Date: Wed, 1 Dec 2004 09:43:36 +0100 [thread overview]
Message-ID: <200412010943.36834.arnd@arndb.de> (raw)
In-Reply-To: <c0a09e5c04113017333c85c7e2@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1699 bytes --]
On Middeweken 01 Dezember 2004 02:33, Andrew Grover wrote:
> On Wed, 10 Nov 2004 13:55:23 +0900, Yoshinori Sato
> <ysato@users.sourceforge.jp> wrote:
> > Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> > -extern __inline__ int generic_fls(int x)
> > +static __inline__ int generic_fls(int x)
>
> Along the lines of this patch, can I ask... if a patch were created to
> replace all instances of "extern inline" with "static inline" would
> that be a good thing or a waste of time? I found a 3 year old thread
> (Jul 27 2001, "Re: [PATCH] gcc-3.0.1 and 2.4.7-ac1") where it sounded
> like a good thing to do, but obviously there are some still around.
If anyone uses extern inline in the way that it is intended, i.e.
provide an inline function in a header and an out-of-line version
of the same function in some C file, that breaks.
It would be pointless to use extern inline this way now, since we define
inline to mean always_inline in the kernel, but gcc will give you a
compile error when it sees the same function defined both as 'static
inline' and as 'extern'. The correct fix is to convert 'extern inline'
to 'static inline' and at the same time remove any external definitions
of the same function.
Another point that has been mentioned before is that forcing inline
to always_inline is not really a good idea. My personal preference
would be to convert all uses of 'extern inline' that are meant as
'this breaks if it is not inline' to something like 'static
__always_inline' instead of plain 'static inline'. Then maybe some
day the annotations get good enough to leave the decision
to the compiler for the regular case.
Arnd <><
[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2004-12-01 8:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-10 4:55 [PATCH] fix "extern inline" Yoshinori Sato
2004-12-01 1:33 ` "extern inline" purge? was: " Andrew Grover
2004-12-01 8:43 ` Arnd Bergmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200412010943.36834.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=andy.grover@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.