tech-kern archive

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

Re: static functions are your friends (Was GPIO revisited)

Am 09.08.2009 um 20:51 schrieb Manuel Bouyer:

On Sun, Aug 09, 2009 at 08:38:31PM +0200, Marc Balmer wrote:
ddb's trace command should produce the function name.

I think it's obvious that it can't when the function has been
inlined. This is not something that can be fixed in ddb,
it's a gcc feature which can be disabled, this is what __noinline is
The problem with __noinline is that it's gcc-specific. As some peoples
compiles NetBSD with a compiler which is not gcc, this has to be encapsulated
in a macro so the __noinline can be easily removed when not supported
(or not needed).

Making the symbol global also prevents gcc from inlining the function.
But this is a side effect of the current GNU toolchain implementation,
I don't think it's safe to rely on this side effect to prevent
inlining where we don't want it.

Look, whatever I suggest, not declare static, or use __inline, calls the trolls. So for now I will not declare static. I tried to find a compromise, it was turned down immediately. Not declaring static fits the purpose and causes no harm.

My functions are non-static until we find a better solution. Macro hell is not a solution, btw.

I spent more time explaining this today than actually writing code. That sucks stinking donkey balls.

- Marc  Balmer

Home | Main Index | Thread Index | Old Index