[lkml]   [1997]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: problems with compiling 2.1.45-7
In dist.linux.kernel, article <>,
James Mastros <> 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    [W:0.052 / U:4.212 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site