LKML Archive on
 help / color / Atom feed
From: Linus Torvalds <>
To: Sasha Levin <>
Cc: "Kirill A. Shutemov" <>,
	Aaro Koskinen <>,
	Andrew Pinski <>,
	Andrew Morton <>,
	Linux Kernel Mailing List <>
Subject: Re: [PATCH] kernel: use the gnu89 standard explicitly
Date: Sun, 19 Oct 2014 17:23:04 -0700
Message-ID: <> (raw)
In-Reply-To: <>

On Sun, Oct 19, 2014 at 4:59 PM, Sasha Levin <> wrote:
>> AndrewP, mind explaing the other difference you mentioned (ie wrt
>> "extern inline")? I thought we had already long since ended up
>> following the gcc semantics (ie use "static inline" if we don't have
>> an external version somehwre), what exactly changed?
> (Stolen from gcc changelog:)
> gnu89: extern inline: Will not generate an out-of-line version, but
>         might call one.
> gnu99: extern inline: like GNU "inline", externally visible code is
>         emitted.
> (So what happens is that with gnu99 you end up with multiple definitions
> of the symbol since it was externed from multiple compilation units).

Oh Christ. So this got broken yet again, even *after* they had
documented the old behavior?

Originally, gcc documented that "extern inline" is a good replacement
for a macro. Then, that changed, and "static inline" became the
replacement for a macro, and "extern inline" was to mean that *if* it
gets inlined, that definition is used, but otherwise there's supposed
to be an external non-inlined copy somewhere else (so the inline
definition of the function is basically entirely ignored when not
inlining for one reason or another).

So now we have a *third* semantic of "extern inline", and one that
seems to be entirely inappropriate to *ever* be used in a header file
due to duplicate symbol problems. What a mess.

Maybe we should just specify "gnu89" to avoid these kinds of insane
semantic changes.


  reply index

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-19 16:07 Sasha Levin
2014-10-19 20:05 ` Linus Torvalds
2014-10-19 20:23   ` Joe Perches
     [not found]     ` <>
2014-10-19 21:31       ` Joe Perches
2014-10-19 21:03   ` Aaro Koskinen
2014-10-19 23:05     ` Linus Torvalds
2014-10-19 23:10       ` Kirill A. Shutemov
2014-10-19 23:19         ` Al Viro
2014-10-19 23:21         ` Kirill A. Shutemov
2014-10-19 23:26           ` Al Viro
2014-10-19 23:49         ` Linus Torvalds
2014-10-19 23:59           ` Sasha Levin
2014-10-20  0:23             ` Linus Torvalds [this message]
2014-10-20  4:16               ` Al Viro
2014-10-19 23:25       ` pinskia
2014-10-19 23:52   ` Sasha Levin
2014-10-19 22:29 ` Kirill A. Shutemov

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone