lkml.org 
[lkml]   [1997]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: problems with compiling 2.1.45-7
Date
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

\
 
 \ /
  Last update: 2005-03-22 13:39    [from the cache]
©2003-2011 Jasper Spaans