linux-mips
[Top] [All Lists]

Re: gcc 3.x, -ansi and "static inline"

To: Jun Sun <jsun@mvista.com>
Subject: Re: gcc 3.x, -ansi and "static inline"
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Sat, 2 Feb 2002 10:17:50 +0100 (MET)
Cc: Linux/MIPS Development <linux-mips@oss.sgi.com>
In-reply-to: <20020201115206.A18085@mvista.com>
Sender: owner-linux-mips@oss.sgi.com
On Fri, 1 Feb 2002, Jun Sun wrote:
> We are trying to build userland apps with the newer kernel headers.
> Unexpected problems occur with the "static inline" declaration
> when "-ansi" option is used.
> 
> Anybody else is having the problem?
> 
> Also, what are the reasons for us to switch to "static inline" in the
> kernel header?
>
> Here is an example I am talking about:
> 
> In 2.4.2, we have in bitops.h:
> 
> extern __inline__ unsigned long ffz(unsigned long word)
> 
> In 2.4.17, we have instead:
> 
> static inline unsigned long ffz(unsigned long word)
> 
> This problem seems only happening with gcc 3.x.  I start to wonder
> whether we should fix kernel header.  In some case, the fix seems
> to be not exposing to userland (by #ifdef __KERNEL__).  In others,
> the fix might be using __inline__.  

Yes, #ifdef __KERNEL__ is the right fix.

> However, I really like to know what was the original motivation
> to do such a change.

See linux-kernel

Gr{oetje,eeting}s,

                                                Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                                            -- Linus Torvalds


<Prev in Thread] Current Thread [Next in Thread>