Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
From: Nick Desaulniers
Date: Thu Jun 07 2018 - 14:52:17 EST
On Thu, Jun 7, 2018 at 11:31 AM Joe Perches <joe@xxxxxxxxxxx> wrote:
>
> On Thu, 2018-06-07 at 10:26 -0700, Nick Desaulniers wrote:
> > I get the feeling that the use of __inline__ or __inline (vs inline)
> > in the kernel may be wrong and their use should be eradicated in the
> > follow up patch set, but it would be cool if others have additional
> > insight.
>
> __inline is easy and useful to remove as it's used in
> just a few files.
>
> But __inline__ is used in a lot of files and locations:
>
> $ git grep -w --name-only __inline__ | wc -l
> 154
> $ git grep -w __inline__ | wc -l
> 503
>
> Some of these files are used in asm includes as
> well where __inline__ may be preferred by gcc
>
> https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html#Alternate-Keywords
>
> so perhaps asm exclusions would be necessary.
Oops, just saw this email after sending v3: https://lkml.org/lkml/2018/6/7/1055
Guess I should re-add __inline__ and __inline then to 1/3?
https://lkml.org/lkml/2018/6/7/1060
ie:
+#define __inline__ __inline__ inline
instead of
+#define __inline__ inline
?
On the other hand, I was able to assemble with gcc+binutils and v3 as it stands.
Reading the link you sent, it seems more about compiling with
-pedantic or non-gnu C standards being used (I'd call that unlikely
for the kernel). So it still seems incorrect to me the use of
__inline__ (but I do appreciate the link!) at least in the kernel.