Messages in this thread | | | From | (Matthias Urlichs) | Subject | Re: problems with compiling 2.1.45-7 | Date | 17 Jul 1997 14:35:47 +0200 |
| |
In dist.linux.kernel, article <869101594.1254@noris.de>, James Mastros <abszero@epix.net> writes: > >-inline void d_drop(struct dentry * dentry) > >+static inline void d_drop(struct dentry * dentry) > > Doesn't that mean that for a given parameter then the fn will always return > the same val, and that it has no side-effects, which is totally false here? > No, that's "const".
Basically, "static" means 'this function is used only here, so omit compiling it if it's always inlined', "extern" means 'this function is never compiled, only inlined' and "(nothing)" means 'inline this, but also compile it, just in case'.
The latter is obviously nonsense for header files because the linnker then complains about multiple definitions. The first binds a static version into every object file which includes the header if GCC doesn't see the optimization (this usually happens if you compile something without -O). 'extern', therefore, is commonly used within the kernel, but it has the disadvantage that it's impossible to compile anything which depends on the inlined function without optimization (because unoptimized code is never inlined with GCC).
-- Matthias Urlichs
| |