linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Andrew Pinski <pinskia@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kernel: use the gnu89 standard explicitly
Date: Sun, 19 Oct 2014 17:23:04 -0700	[thread overview]
Message-ID: <CA+55aFwGWbRcrRxnmc7JrEZh+25zNVw7_PqQiCThHr1An=C4_g@mail.gmail.com> (raw)
In-Reply-To: <54445079.4000803@oracle.com>

On Sun, Oct 19, 2014 at 4:59 PM, Sasha Levin <sasha.levin@oracle.com> 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.

                     Linus

  reply	other threads:[~2014-10-20  0:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-19 16:07 [PATCH] kernel: use the gnu89 standard explicitly Sasha Levin
2014-10-19 20:05 ` Linus Torvalds
2014-10-19 20:23   ` Joe Perches
     [not found]     ` <CA+55aFwbq4TtQXC9PTjOF3UPP7u8XH1mSYjvT7pevKcQBfy25A@mail.gmail.com>
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 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='CA+55aFwGWbRcrRxnmc7JrEZh+25zNVw7_PqQiCThHr1An=C4_g@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=aaro.koskinen@iki.fi \
    --cc=akpm@linux-foundation.org \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pinskia@gmail.com \
    --cc=sasha.levin@oracle.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).