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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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__.  

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

BTW, the inclusion of "mipsregs.h" file in bitops.h seems unnecessary
and caused a bunch of similar errors.

Jun


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux