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 19:40 schrieb Ted Lemon:

On Aug 9, 2009, at 1:34 PM, Adam Hoka wrote:
Maybe other compilers dont grok __noinline or someone wants to make them
inline anyway, who knows. :-)

When you're writing code for a project that's used by others, your preferences matter, but so do the preferences of others. So when setting things up for your convenience, it's worth considering what will be convenient for others as well. That's not to say you shouldn't set things up for your own convenience - just make sure you've done the right thing for others as well.

when I set up things so that ddb gives useful output in the case of a crash, I have just done that, right?

If I follow "extremist" rules and ddb will not give useful information in case of a crash, I violated this, right?

See, that is why I do not declare functions static. Gcc likely inlines them and ddb trace output becomes useless.

When gcc/ddb is fixed, we can switch the functions to static. Right now we cant.

Home | Main Index | Thread Index | Old Index