Hi astian, > Date: 2026-09-12 21:58:26+0000 > From: astian > [...] > >> 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 --