From: Alejandro Colomar <alx@kernel.org>
To: astian <astian@memeware.net>
Cc: Arnd Bergmann <arnd@arndb.de>, Andreas Jaeger <aj@suse.de>,
linux-man <linux-man@vger.kernel.org>,
Linux-Arch <linux-arch@vger.kernel.org>
Subject: Re: outb(2): terminology correction
Date: Sun, 13 Sep 2026 00:09:59 +0200 [thread overview]
Message-ID: <aqXNK3qkcOZNwWOZ@devuan> (raw)
In-Reply-To: <DLDOAQWX9IIH.E1ZNJ3O80VQ@memeware.net>
[-- Attachment #1: Type: text/plain, Size: 2370 bytes --]
Hi astian,
> Date: 2026-09-12 21:58:26+0000
> From: astian <astian@memeware.net>
>
[...]
> >> Arnd, should we remove the paragraph entirely? Or is there any obscure
> >> reason why optimizations are required?
> >
> > Or maybe those assembly instructions are what causes the linker issues?
> > If so, we should probably say something about that.
>
> I had a closer look and I now think that's not the case. These
> instructions work fine even if the function is not inlined. See more
> below.
Thanks!
> On 11 Sep 2026 14:20 +0200, Arnd Bergmann wrote:
[...]
> > Using 'extern __inline' without optimization in --std=gnu89 would lead to
> > the compiler using an 'extern' reference rather than emitting a static
> > version,
>
> This seems to be the original reason for the optimisation requirement.
Agree.
> The manual says [0]:
>
> GCC does not inline any functions when not optimizing unless you
> specify the ‘always_inline’ attribute for the function [...]
>
> [...]
>
> If you specify both inline and extern in the function definition, then
> the definition is used only for inlining. In no case is the function
> compiled on its own, not even if you refer to its address explicitly.
> Such an address becomes an external reference, as if you had only
> declared the function, and had not defined it.
>
> This combination of inline and extern has almost the effect of a
> macro. [...]
>
> 0: https://gcc.gnu.org/onlinedocs/gcc/Inline.html
>
> Thus, using "extern inline" but not enabling optimisations (and not
> providing a separate definition in some other object) would have
> produced a linker error.
Indeed.
> > the 'static __inline' variant works as intended in both gnu
> > and standard c99.
>
> That "__inline" keyword (yes, it's a keyword, regardless of eponymous
> macros) is odd. Apparently an old non-standard import from MSVC.
>
> Are standard/newer keywords (inline/__inline__) not used for reasons of
> backward compatibility (with old compiler or C language versions)?
Yes, glibc needs to be compatible with C89, which doesn't have 'inline'.
Since users of C89 could be defining 'inline' for anything, glibc has to
use something in the implementation namespace.
Have a lovely night!
Alex
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2026-09-12 22:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <DL30FONT5B6G.1ETPJ04T023RU@memeware.net>
2026-09-11 11:36 ` outb(2): terminology correction Alejandro Colomar
2026-09-11 11:43 ` Alejandro Colomar
2026-09-11 12:20 ` Arnd Bergmann
2026-09-11 12:54 ` [PATCH v1] man/man2/outb.2: Remove obsolete note about optimizations Alejandro Colomar
2026-09-12 21:58 ` outb(2): terminology correction astian
2026-09-12 22:09 ` Alejandro Colomar [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=aqXNK3qkcOZNwWOZ@devuan \
--to=alx@kernel.org \
--cc=aj@suse.de \
--cc=arnd@arndb.de \
--cc=astian@memeware.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-man@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox